[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

possible bug in newCDKRadio ?

From: ruben
Subject: possible bug in newCDKRadio ?
Date: Fri, 18 Apr 2003 23:21:06 +0200


its possible that im wrong but i checked that function on several independant systems. i have a problem with newCDKRadio, with the defaultItem, to be more exactly. it is impossible to select an item, even with the example code delivered with the packages.

here my package list
un  gsn-curses     <none>         (no description available)
ii  libcurses-perl 1.06-2         Curses interface for Perl
pn  libcurses-ruby <none>         (no description available)
un  libcurses-widg <none>         (no description available)
un  libncurses-dev <none>         (no description available)
ii  libncurses4    4.2-9          Shared libraries for terminal handling
pn  libncurses4-de <none>         (no description available)
ii  libncurses5    5.2.20020112a- Shared libraries for terminal handling
pn  libncurses5-db <none>         (no description available)
ii libncurses5-de 5.2.20020112a- Developer's libraries and docs for ncurses
un  ncurses        <none>         (no description available)
ii  ncurses-base   5.2.20020112a- Descriptions of common terminal types
ii  ncurses-bin    5.2.20020112a- Terminal-related programs and man pages
un  ncurses-dev    <none>         (no description available)
un  ncurses-develo <none>         (no description available)
pn  ncurses-hexedi <none>         (no description available)
un  ncurses-runtim <none>         (no description available)
ii  ncurses-term   5.2.20020112a- Additional terminal type definitions
un  ncurses21-dev  <none>         (no description available)
pn  ncurses3.0     <none>         (no description available)
pn  ncurses3.0-alt <none>         (no description available)
pn  ncurses3.4     <none>         (no description available)
un  perl-curses    <none>         (no description available)
un  pyncurses      <none>         (no description available)
un  python-curses  <none>         (no description available)

and the example code:
#include <cdk/cdk.h>

int main (int argc, char **argv)
   CDKSCREEN *cdkscreen = (CDKSCREEN *)NULL;
   CDKRADIO *radio      = (CDKRADIO *)NULL;
   WINDOW *cursesWin    = (WINDOW *)NULL;
   char *title          = "<C></5>Selection";
   int selection, count = 3, x;
   char *mesg[10], temp[100];
   char *item[10] = {"uno", "due", "tre", "quattro", "cinque"};
   int defaultItem = 3;

   cursesWin = initscr();
   cdkscreen = initCDKScreen (cursesWin);

   radio = newCDKRadio (cdkscreen, CENTER, CENTER, RIGHT,
                        10, 40, title, item, count,
                        '#'|A_REVERSE, defaultItem,
                        A_REVERSE, TRUE, FALSE);

   selection = activateCDKRadio (radio, (chtype *)NULL);

   if (radio->exitType == vESCAPE_HIT)
      mesg[0] = "<C>You hit escape. No item selected.";
      mesg[1] = "",
      mesg[2] = "<C>Press any key to continue.";
      popupLabel (cdkscreen, mesg, 3);
   } else if (radio->exitType == vNORMAL) {
      mesg[0] = "<C>You selected the filename";
      sprintf (temp, "<C>%s", item[selection]);
      mesg[1] = copyChar (temp);
      mesg[2] = "";
      mesg[3] = "<C>Press any key to continue.";
      popupLabel (cdkscreen, mesg, 4);
      freeChar (mesg[1]);

   destroyCDKRadio (radio);
   destroyCDKScreen (cdkscreen);
   delwin (cursesWin);
   exit (0);

i hope you guys can confirm that its a bug and it will get fixed soon.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]