|
From: | Craig Thornton |
Subject: | [paragui-users] Listbox select and add |
Date: | Wed, 7 Aug 2002 12:29:23 -0300 |
Andrew,
Here is the code that works if there are no
items in the listbox selected. When an item is selected and access violation
occurs. This happens when the function is exited, and the return value set
true/false doesn't fix it. The variable b tries to get the item that is selected
and unselect it. This doesn't work.
Craig
PARAGUI_CALLBACK(nexthandle) {
PG_Application *app = (PG_Application *) clientdata; PG_LineEdit *s1 = (PG_LineEdit *) app->GetWidgetById(100); PG_LineEdit *s2 = (PG_LineEdit *) app->GetWidgetById(101); PG_LineEdit *s3 = (PG_LineEdit *) app->GetWidgetById(102); PG_ListBox *b1 = (PG_ListBox *) app->GetWidgetById(200); string t1 = s1->GetText(); string t2 = s2->GetText(); string t3 = s3->GetText(); string tt = t1+","+t2+","+t3; PG_ListBoxBaseItem *b; s1->SetText(""); s2->SetText(""); s3->SetText(""); b = b1->GetSelectedItem(); b1->AddItem(new PG_ListBoxItem(30, tt.c_str())); s1->Update(); s2->Update(); s3->Update(); b1->SelectItem(b, false); b1->Update(); return false; } |
[Prev in Thread] | Current Thread | [Next in Thread] |