1
0
Fork 0

make puList actually useful: call back on list entry selection.

(again: I'll submit all the changes to plib's puaList as soon as
possibe. Just needs a few more fixes first ... :-)
This commit is contained in:
mfranz 2006-03-23 19:03:31 +00:00
parent a7bab83cc8
commit 2726cda057

View file

@ -17,6 +17,17 @@ handle_slider (puObject * slider)
}
/**
* Static function: handle list entry clicks.
*/
static void
handle_list_entry (puObject * listbox)
{
puListBox * box = (puListBox *)listbox->getUserData();
box->invokeCallback();
}
/**
* Static function: handle arrow clicks.
*/
@ -97,6 +108,7 @@ puList::init (int w, int h)
_list_box = new puListBox(0, 0, w-30, h);
_list_box->setStyle(-PUSTYLE_SMALL_SHADED);
_list_box->setUserData(this);
_list_box->setCallback(handle_list_entry);
_list_box->setValue(0);
_slider = new puSlider(w-30, 30, h-60, true);