summaryrefslogtreecommitdiff
path: root/textscreen/examples
diff options
context:
space:
mode:
authorSimon Howard2009-01-30 23:53:47 +0000
committerSimon Howard2009-01-30 23:53:47 +0000
commit39b7cb7bb2e14169af5dc07c7d429fc939200639 (patch)
tree3dec16991e926a3eeb448d22e156acec85b0347d /textscreen/examples
parenta6be65e608b72b3e08ea66278e3972864c085495 (diff)
downloadchocolate-doom-39b7cb7bb2e14169af5dc07c7d429fc939200639.tar.gz
chocolate-doom-39b7cb7bb2e14169af5dc07c7d429fc939200639.tar.bz2
chocolate-doom-39b7cb7bb2e14169af5dc07c7d429fc939200639.zip
Fix layout of widgets within scroll panes. Scroll scroll panes in
response to keyboard events. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1440
Diffstat (limited to 'textscreen/examples')
-rw-r--r--textscreen/examples/guitest.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/textscreen/examples/guitest.c b/textscreen/examples/guitest.c
index 893974df..792e38cc 100644
--- a/textscreen/examples/guitest.c
+++ b/textscreen/examples/guitest.c
@@ -82,6 +82,7 @@ void SetupWindow(void)
TXT_AddWidget(window, toplabel);
TXT_SetWidgetAlign(toplabel, TXT_HORIZ_CENTER);
+ //TXT_AddWidget(window, TXT_NewScrollPane(15, 4, table));
TXT_AddWidget(window, table);
for (i=0; i<5; ++i)
@@ -174,6 +175,35 @@ void Window2(void)
TXT_AddWidget(window, scrollpane);
}
+void ScrollingMenu(void)
+{
+ txt_window_t *window;
+ txt_button_t *button;
+ txt_table_t *table;
+
+ window = TXT_NewWindow("Scrollable menu");
+
+ table = TXT_NewTable(1);
+
+ TXT_AddWidgets(table,
+ TXT_NewButton("Configure display"),
+ TXT_NewButton("Configure joystick"),
+ TXT_NewButton("Configure keyboard"),
+ TXT_NewButton("Configure mouse"),
+ TXT_NewButton("Configure sound"),
+ TXT_NewStrut(0, 1),
+ button = TXT_NewButton("Save Parameters and launch DOOM"),
+ TXT_NewStrut(0, 1),
+ TXT_NewButton("Start a network game"),
+ TXT_NewButton("Join a network game"),
+ TXT_NewButton("Multiplayer configuration"),
+ NULL);
+
+ TXT_SignalConnect(button, "pressed", PwnBox, NULL);
+
+ TXT_AddWidget(window, TXT_NewScrollPane(0, 6, table));
+}
+
int main(int argc, char *argv[])
{
if (!TXT_Init())
@@ -184,6 +214,7 @@ int main(int argc, char *argv[])
TXT_SetDesktopTitle("Not Chocolate Doom Setup");
+ ScrollingMenu();
Window2();
SetupWindow();