Mercurial > pidgin.yaz
comparison finch/libgnt/pygnt/test.py @ 18556:5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
well now.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Tue, 17 Jul 2007 11:09:03 +0000 |
parents | 8fd5ab3f9716 |
children | 6b16fca71f8b |
comparison
equal
deleted
inserted
replaced
18554:ab58b55f38b0 | 18556:5e1412f4e67a |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 import gnt | 2 import gnt |
3 | 3 |
4 def button_activate(button, entry): | 4 def button_activate(button, tree): |
5 entry.set_text("clicked!!!") | 5 list = tree.get_selection_text_list() |
6 str = "" | |
7 for i in list: | |
8 str = str + i | |
9 entry.set_text("clicked!!!" + str) | |
6 | 10 |
7 gnt.gnt_init() | 11 gnt.gnt_init() |
8 | 12 |
9 win = gnt.Window() | 13 win = gnt.Window() |
10 | 14 |
14 win.set_title("Entry") | 18 win.set_title("Entry") |
15 | 19 |
16 button = gnt.Button("Click!") | 20 button = gnt.Button("Click!") |
17 win.add_widget(button) | 21 win.add_widget(button) |
18 | 22 |
19 button.connect("activate", button_activate, entry) | 23 tree = gnt.Tree() |
24 tree.set_property("columns", 1) | |
25 win.add_widget(tree) | |
26 | |
27 # so random non-string values can be used as the key for a row in a GntTree! | |
28 last = None | |
29 for i in range(1, 100): | |
30 tree.add_row_after(i, [str(i), ""], None, i-1) | |
31 tree.add_row_after(entry, ["asd"], None, None) | |
32 tree.add_row_after("b", ["123", ""], entry, None) | |
33 | |
34 button.connect("activate", button_activate, tree) | |
20 | 35 |
21 win.show() | 36 win.show() |
22 | 37 |
23 gnt.gnt_main() | 38 gnt.gnt_main() |
24 | 39 |