diff options
author | Simon Howard | 2010-12-10 20:31:46 +0000 |
---|---|---|
committer | Simon Howard | 2010-12-10 20:31:46 +0000 |
commit | 56824b130b786aab49876a71c6c768a17c5a4f1c (patch) | |
tree | f05611777e7b7014d0764fc957ea3b2c2543a054 /textscreen/examples/guitest.c | |
parent | 9caebe584ccb95239b2ed360d4bce3dffc5ecfea (diff) | |
download | chocolate-doom-56824b130b786aab49876a71c6c768a17c5a4f1c.tar.gz chocolate-doom-56824b130b786aab49876a71c6c768a17c5a4f1c.tar.bz2 chocolate-doom-56824b130b786aab49876a71c6c768a17c5a4f1c.zip |
Replace txt_widget_t#selectable with a callback function to query
whether the widget is selectable. This stops the table code from
selecting things that aren't really selectable - eg. empty tables,
scrollpanes containing unselectable widgets, etc.
Fixes a bug with the warp menu (thanks Proteh).
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2207
Diffstat (limited to 'textscreen/examples/guitest.c')
-rw-r--r-- | textscreen/examples/guitest.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/textscreen/examples/guitest.c b/textscreen/examples/guitest.c index 5a931949..df79be2d 100644 --- a/textscreen/examples/guitest.c +++ b/textscreen/examples/guitest.c @@ -163,8 +163,8 @@ void Window2(void) { txt_window_t *window; txt_table_t *table; + txt_table_t *unselectable_table; txt_scrollpane_t *scrollpane; - int i; window = TXT_NewWindow("Another test"); TXT_SetWindowPosition(window, @@ -172,10 +172,13 @@ void Window2(void) TXT_VERT_TOP, TXT_SCREEN_W - 1, 1); - for (i=0; i<5; ++i) - { - TXT_AddWidget(window, TXT_NewButton("hello there blah blah blah blah")); - } + TXT_AddWidgets(window, + TXT_NewScrollPane(40, 1, + TXT_NewLabel("* Unselectable scroll pane *")), + unselectable_table = TXT_NewTable(1), + NULL); + + TXT_AddWidget(unselectable_table, TXT_NewLabel("* Unselectable table *")); TXT_AddWidget(window, TXT_NewSeparator("Input boxes")); table = TXT_NewTable(2); |