Hi folks
Today I wanna ask about context management. Here's a pseudocode skeleton of
the code I'm working on. The question is in the swap() routine.
inching ever closer to success
Mark
main(){
pgInit();
pgRegisterApp();
pgEnterContext(); // context 1
create some buttons and pgBind 1 of them to entryList
pgEventLoop();
pgLeaveContext(); // context 1
}
entryList(){
pgEnterContext(); //context 2
create a new popup
put a PG_WIDGET_BOX in it
put a bunch of PG_WIDGET_LISTITEMs in the box and
bind each to dataEntry
create exit button and bind it to exitRtne
// this exits context 2, right?
pgEventLoop();
}
dataEntry(){
pgEnterContext() // context 3
grab and save text from PG_WIDGET_LISTITEM
create new popup
create PG_WIDGET_FIELD in the popup, load it with
the saved text and pgBind it to
swapStringsAndExit rtne
pgEventLoop()
}
swap(){
grab text from PG_WIDGET_FIELD in dataEntry
compare with text from PG_WIDGET_LISTITEM in
entryList
if they are different
use pgSetWidget to place new text in
PG_WIDGET_LISTITEM from entryList
pgLeaveContext() //exit context 3, right?
QUESTION: Using gdb & printf's I've verified that the text from the widgets
is what I expect and that the pghandles of the widgets are also correct and
that I'm placing the correct text in the correct widget. The problem is,
after the PG_WIDGET_FIELD is removed from the screen (by swap()s
pgLeaveContext or pgLeaveContext bound to dataEntry's exit widget, I don't
know which one)
the new text is not displayed in the list from entryList.
I don't understand why. Can someone tell me where my
understanding of picoGui's context management has failed?
}
exit(){
pgLeaveContext();
}
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pgui-devel