Mercurial > pidgin.yaz
comparison console/libgnt/test/focus.c @ 13960:a06f7495af6f
[gaim-migrate @ 16513]
It is possible to have multiple gnt-applications sharing the same screen.
To try this, 'make WM' in console/libgnt/test. It will have a small
'Command' entry. You can give a command like './focus.so' (or one of the
other examples). The applications can also be executed standalone. This
required some tinkering to the Makefile. I am not sure whether there is
an easier way of doing it.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 17 Jul 2006 22:27:26 +0000 |
parents | 8b2306c64efa |
children | 0a0d2a1fd2bc |
comparison
equal
deleted
inserted
replaced
13959:2ae35c0cf616 | 13960:a06f7495af6f |
---|---|
18 gnt_widget_show(w); | 18 gnt_widget_show(w); |
19 } | 19 } |
20 | 20 |
21 int main() | 21 int main() |
22 { | 22 { |
23 #ifdef STANDALONE | |
23 freopen(".error", "w", stderr); | 24 freopen(".error", "w", stderr); |
24 gnt_init(); | 25 gnt_init(); |
25 | 26 #endif |
27 | |
26 GntWidget *label = gnt_label_new("So wassup dudes and dudettes!!\nSo this is, like,\nthe third line!! \\o/"); | 28 GntWidget *label = gnt_label_new("So wassup dudes and dudettes!!\nSo this is, like,\nthe third line!! \\o/"); |
27 GntWidget *vbox, *hbox, *tree, *box, *button; | 29 GntWidget *vbox, *hbox, *tree, *box, *button; |
28 WINDOW *test; | 30 WINDOW *test; |
29 | |
30 box(stdscr, 0, 0); | |
31 wrefresh(stdscr); | |
32 | 31 |
33 vbox = gnt_box_new(FALSE, FALSE); | 32 vbox = gnt_box_new(FALSE, FALSE); |
34 hbox = gnt_box_new(FALSE, TRUE); | 33 hbox = gnt_box_new(FALSE, TRUE); |
35 gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); | 34 gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); |
36 | 35 |
56 gnt_tree_add_choice(GNT_TREE(tree), "b", "b", "d", NULL); | 55 gnt_tree_add_choice(GNT_TREE(tree), "b", "b", "d", NULL); |
57 | 56 |
58 GNT_WIDGET_UNSET_FLAGS(hbox, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); | 57 GNT_WIDGET_UNSET_FLAGS(hbox, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); |
59 gnt_box_set_title(GNT_BOX(hbox), "This is the title …"); | 58 gnt_box_set_title(GNT_BOX(hbox), "This is the title …"); |
60 | 59 |
61 | |
62 g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(toggled), NULL); | 60 g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(toggled), NULL); |
63 | 61 |
64 button = gnt_button_new("one"); | 62 button = gnt_button_new("one"); |
65 gnt_widget_set_name(button, "one"); | 63 gnt_widget_set_name(button, "one"); |
66 gnt_box_add_widget(GNT_BOX(vbox), button); | 64 gnt_box_add_widget(GNT_BOX(vbox), button); |
75 | 73 |
76 gnt_box_add_widget(GNT_BOX(hbox), vbox); | 74 gnt_box_add_widget(GNT_BOX(hbox), vbox); |
77 | 75 |
78 gnt_widget_show(hbox); | 76 gnt_widget_show(hbox); |
79 | 77 |
78 #ifdef STANDALONE | |
80 gnt_main(); | 79 gnt_main(); |
81 | 80 |
82 gnt_quit(); | 81 gnt_quit(); |
82 #endif | |
83 | 83 |
84 return 0; | 84 return 0; |
85 } | 85 } |
86 | 86 |