Hello Micah,

> Hmm... I can't reproduce this problem. I run pgserver, then pgboard with the
> us_qwerty_scalable_helvetica8 keyboard. I then run your included program. I can
> use the tab and spacebar on the virtual keyboard to open the menu, and the menu
> works fine. 

This problem still seems to appear, but it is quite hard to reproduce.

I am using basically the same code as Fr�d�ric, and the menu shows up
sometimes OK, sometimes mangled. I have not been able to find a proper way
to trigger the effect, other that running pgboard, running the attached
program, and going into a sequence of:

1) Click on the "Tab" key on the virtual keyboard
2) Click on the "Space" key on the virtual keyboard
3) If the menu shows up normally, select an option and go back to 1)

I have tried to put 'sleep()'s in various places in the code, as well as
creating a huge load on my machine, but nothing seems to affect the
problem.

On our platform (much slower than my development machine), however,
the attached program with pgboard generates a mangled menu pretty much
every time.

I suspect some kind of weird timing/race to the graphic display, but I
can't be more precise ;-( .

I am attaching my code, as well as a screenshot of my pgserver window when
the menu shows up mangled (pgserver is run as 'pgserver -m240x320x1').

Thanks for any help!

-Christian

-- 
Christian Grigis                        |       SMARTDATA SA
Software Engineer                       |       PSE-A / EPFL
Phone: +41-(21)-693-84-98               |       CH - 1015 Lausanne
mailto:[EMAIL PROTECTED]    |       http://www.smartdata.ch


#include <picogui.h>

int but1_handler (struct pgEvent * evt)
{
  int selected = pgMenuFromString 
("First|Second|Third|Fourth|Fifth|Sixth|Seventh|Eighth|Ninth");

  printf ("Selected: %d\n", selected);
}

int main (int argc, char * argv [])
{
  pghandle but1;

  pgInit (argc, argv);
  pgRegisterApp (PG_APP_TOOLBAR, "Menu Test", 0);

  but1 = pgNewWidget (PG_WIDGET_BUTTON, PGDEFAULT, PGDEFAULT);
  pgSetWidget (but1,
               PG_WP_SIDE, PG_S_TOP,
               PG_WP_TEXT, pgNewString ("Click me"),
               0);

  pgBind (but1, PG_WE_ACTIVATE, &but1_handler, NULL);

  pgEventLoop ();

  return 0;
}

Attachment: mangled_menu.png
Description: PNG image

Reply via email to