#599412 [libnewt0.52] Radio boxes not working as expected

Package:
libnewt0.52
Source:
newt
Description:
Not Erik's Windowing Toolkit - text mode windowing with slang
Submitter:
Simon Frankenberger
Date:
2011-12-03 21:27:04 UTC
Severity:
normal
#599412#5
Date:
2010-10-07 12:38:02 UTC
From:
To:
Hello,

With the packages from stable, the radio boxes created with
newtRadiobutton() do not work as expected. In the following example
code, the 2nd box can not be selected, the dialog instantly closes when
you try to select it with the space key.

Another problem is, when you got more boxes (e.g. 5 or 7) and select the
4th box the cursor instantly jumps down to the next option.
--- Code start
#include <newt.h>
#include <stdlib.h>
#include <stdio.h>

int main(void) {
  newtComponent form, checkbox, rb[3], button;

  newtInit();
  newtCls();

  newtOpenWindow(10, 5, 40, 11, "Example for bug");

  rb[0] = newtRadiobutton(1, 3, "Choice 1", 1, NULL);
  rb[1] = newtRadiobutton(1, 4, "Choice 2", 0, rb[0]);
  rb[2] = newtRadiobutton(1, 5, "Choice 3", 0, rb[1]);

  button = newtButton(1, 7, "Ok");
  form = newtForm(NULL, NULL, 0);

  int i=0;
  for (i = 0; i < 3; i++)
    newtFormAddComponent(form, rb[i]);
  newtFormAddComponent(form, button);

  newtRunForm(form);
  newtFinished();

  return 0;
}
--- Code end The problem does not occur when you use the packages from squeeze / testing (Version 0.52.11-1). Greetings from Germany, Simon Frankenberger
#599412#10
Date:
2011-12-03 21:25:38 UTC
From:
To:
Hello,

both problem described also happen when using the PHP newt interface. If
libnewt is compiled from the original source code without Debian patches,
these problems are not present.

Regards

Christian Scheucher