Hello all,
the last version of PicoGUI server crash when we put scrollbar in a
pgDialogBox(). It seem to depend on the size of the box which have the
text we want to scroll.
Attached is a sample (derived from demo) which has the problem. If you
look at lines 28 to 31 :
- putting the line with PG_S_ALL crash the server
- putting the line with a size like 190 or bigger crash the server
- putting the line with a size like 180 or lower don't crash the server,
but it make a space between the button and the box.
With an old release (maybe one week old, not really more, but I'm not
sure), a code with the PG_S_ALL work great.
Any help ?
Thanks in advance.
Olivier
--
Olivier Bornet SMARTDATA SA
[EMAIL PROTECTED] Centre du Parc
http://www.smartdata.ch av. des Pr�s-Beudin 20
Phone +41-27-723'55'03 1920 Martigny
Fax +41-27-723'55'19 Phone +41-27-723'55'18
#include <picogui.h>
/*** Main program */
int main(int argc, char *argv[])
{
pghandle wToolbar,wBox,wText;
int result;
pgInit(argc,argv);
/**** Register our application */
pgRegisterApp(PG_APP_NORMAL,"Demo Application",0);
/* So we can easily clean up this mess later */
pgEnterContext();
/* create a dialog */
pgDialogBox( "Hello" );
/* ... a toolbar for putting the CLOSE button */
wToolbar = pgNewWidget( PG_WIDGET_TOOLBAR, 0, 0 );
pgSetWidget( PGDEFAULT, PG_WP_SIDE, PG_S_BOTTOM, 0 );
/* ... the box with the message */
wBox = pgNewWidget(PG_WIDGET_BOX,0,0);
// pgSetWidget( 0, PG_WP_SIDE, PG_S_ALL, 0 );
pgSetWidget(0,
PG_WP_SIZE,190,
0);
/**** Text inside the box */
wText = pgNewWidget(PG_WIDGET_LABEL,PG_DERIVE_INSIDE,wBox);
pgSetWidget(0,
PG_WP_SIDE,PG_S_ALL,
PG_WP_TEXT,pgNewString(
"Mobile internet appliances\n"
"will likely be the smart merge\n"
"of computer power, multimedia,\n"
"Internet, wireless telecommunication\n"
"technology and fashion; this is the\n"
"reason why this market is to be\n"
"considered as one of the major fast\n"
"growing markets at the beginning\n"
"of this millennium.\n"
"\n----------------------------------------------------\n\n"
"This is more text\n"
" (for your scrolling pleasure)\n"
"Brought to you by pgSetWidget() and pgNewString()\n"),
0);
/* Add a scrollbar */
pgNewWidget(PG_WIDGET_SCROLL,PG_DERIVE_BEFORE,wText);
pgSetWidget(0,
PG_WP_BIND,wText,
0);
/* ... the CLOSE button */
pgNewWidget( PG_WIDGET_BUTTON, PG_DERIVE_INSIDE, wToolbar );
pgSetWidget( PGDEFAULT,
PG_WP_TEXT, pgNewString( "CLOSE" ),
PG_WP_SIDE, PG_S_ALL,
0 );
pgSetPayload( PGDEFAULT, 1 );
do {
/* get the current Payload */
result = pgGetPayload( pgGetEvent()->from );
printf( "9a:%d\n", result );
} while( result != 1 );
/* Free all this memory we used */
pgLeaveContext();
/* ... */
return 0;
}