Mercurial > pidgin
comparison console/libgnt/test/combo.c @ 13935:cd2da4b079cf
[gaim-migrate @ 16466]
New widget GntComboBox. I have addde a test file as an example as well.
Rename gntutils.* to gntmarshal.*
I am going to have some util-functions in gntutils.* later.
committer: Tailor Script <tailor@pidgin.im>
| author | Sadrul Habib Chowdhury <imadil@gmail.com> |
|---|---|
| date | Sat, 08 Jul 2006 23:58:20 +0000 |
| parents | |
| children | 669898e6aa11 |
comparison
equal
deleted
inserted
replaced
| 13934:ef0d515b9f97 | 13935:cd2da4b079cf |
|---|---|
| 1 #include <gnt.h> | |
| 2 #include <gntbox.h> | |
| 3 #include <gntcombobox.h> | |
| 4 #include <gntlabel.h> | |
| 5 | |
| 6 int main() | |
| 7 { | |
| 8 GntWidget *box, *combo, *button; | |
| 9 | |
| 10 gnt_init(); | |
| 11 | |
| 12 box = gnt_box_new(FALSE, FALSE); | |
| 13 | |
| 14 gnt_box_set_toplevel(GNT_BOX(box), TRUE); | |
| 15 gnt_box_set_title(GNT_BOX(box), "Checkbox"); | |
| 16 | |
| 17 combo = gnt_combo_box_new(); | |
| 18 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "1", "1"); | |
| 19 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "2", "2"); | |
| 20 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "3", "3"); | |
| 21 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "4", "4"); | |
| 22 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "5", "5"); | |
| 23 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "6", "6"); | |
| 24 | |
| 25 gnt_box_add_widget(GNT_BOX(box), gnt_label_new("Select")); | |
| 26 gnt_box_add_widget(GNT_BOX(box), combo); | |
| 27 | |
| 28 button = gnt_button_new("OK"); | |
| 29 gnt_box_add_widget(GNT_BOX(box), button); | |
| 30 | |
| 31 gnt_widget_show(box); | |
| 32 | |
| 33 gnt_main(); | |
| 34 | |
| 35 gnt_quit(); | |
| 36 | |
| 37 return 0; | |
| 38 } | |
| 39 |
