summaryrefslogtreecommitdiff
path: root/textscreen/examples
diff options
context:
space:
mode:
authorSimon Howard2010-12-10 20:31:46 +0000
committerSimon Howard2010-12-10 20:31:46 +0000
commit56824b130b786aab49876a71c6c768a17c5a4f1c (patch)
treef05611777e7b7014d0764fc957ea3b2c2543a054 /textscreen/examples
parent9caebe584ccb95239b2ed360d4bce3dffc5ecfea (diff)
downloadchocolate-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')
-rw-r--r--textscreen/examples/guitest.c13
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);