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:
parent
a7bab83cc8
commit
2726cda057
1 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue