]> git.mxchange.org Git - flightgear.git/commitdiff
make puList actually useful: call back on list entry selection.
authormfranz <mfranz>
Thu, 23 Mar 2006 19:03:31 +0000 (19:03 +0000)
committermfranz <mfranz>
Thu, 23 Mar 2006 19:03:31 +0000 (19:03 +0000)
(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

index 4654084adb66772bbf469149266adc7272612395..b9534377967eaaf62c0437c1f1b588fefe0a185e 100644 (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);