From 2726cda0570b7cb02856cfe19c99207aeabbd02d Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 23 Mar 2006 19:03:31 +0000 Subject: [PATCH] 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 ... :-) --- src/GUI/puList.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/GUI/puList.cxx b/src/GUI/puList.cxx index 4654084ad..b95343779 100644 --- a/src/GUI/puList.cxx +++ b/src/GUI/puList.cxx @@ -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); -- 2.39.5