diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 09:27:57 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 09:27:57 -0700 |
commit | 928ccf929c26a5344c224303b5108e99c2eb597a (patch) | |
tree | 6d371148311fe4467b0c9a208e9c36d24380c75e /examples/list/editable.py |
Imported Upstream version 1.9.8
Diffstat (limited to 'examples/list/editable.py')
-rw-r--r-- | examples/list/editable.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/list/editable.py b/examples/list/editable.py new file mode 100644 index 0000000..aa4def2 --- /dev/null +++ b/examples/list/editable.py @@ -0,0 +1,29 @@ +import gtk + +from kiwi.ui.objectlist import Column, ObjectList + +class Fruit: + def __init__(self, name, cost): + self.name = name + self.cost = cost + +fruits = ObjectList([Column('name', data_type=str, editable=True, + expand=True), + Column('cost', data_type=int, editable=True)]) + +for name, cost in [('Apple', 4), + ('Pineapple', 2), + ('Kiwi', 8), + ('Banana', 3), + ('Melon', 5)]: + fruits.append(Fruit(name, cost)) + +window = gtk.Window() +window.connect('delete-event', gtk.main_quit) +window.set_title('Editable Fruit List') +window.set_size_request(230, 150) + +window.add(fruits) +window.show_all() + +gtk.main() |