From 56824b130b786aab49876a71c6c768a17c5a4f1c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 10 Dec 2010 20:31:46 +0000 Subject: 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 --- textscreen/examples/guitest.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'textscreen/examples') 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); -- cgit v1.2.3