2012-11-01 14:23:49 +01:00
|
|
|
#!/usr/bin/python
|
|
|
|
from gi.repository import Gtk
|
|
|
|
|
|
|
|
import common
|
|
|
|
test = common.Test()
|
|
|
|
test.show()
|
|
|
|
|
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
class MyBox(Gtk.Box):
|
2012-11-01 14:23:49 +01:00
|
|
|
|
|
|
|
def __init__(self):
|
2017-01-11 18:23:08 +01:00
|
|
|
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
|
2012-11-01 14:23:49 +01:00
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
scrolled = Gtk.ScrolledWindow()
|
|
|
|
scrolled.set_policy(Gtk.PolicyType.AUTOMATIC,
|
|
|
|
Gtk.PolicyType.AUTOMATIC)
|
2012-11-01 14:23:49 +01:00
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
store = Gtk.ListStore(str, str)
|
2012-11-01 14:23:49 +01:00
|
|
|
for i in range(5):
|
2017-01-11 18:23:08 +01:00
|
|
|
store.append([str(i), 'Item %s' % i])
|
2012-11-01 14:23:49 +01:00
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
treeview = Gtk.TreeView(store)
|
2012-11-01 14:23:49 +01:00
|
|
|
renderer_no_sens = Gtk.CellRendererText()
|
|
|
|
# set 'sensitive' property
|
|
|
|
renderer_no_sens.set_property('sensitive', False)
|
|
|
|
|
|
|
|
renderer = Gtk.CellRendererText()
|
|
|
|
|
|
|
|
column = Gtk.TreeViewColumn('\'sensitive\' False',
|
|
|
|
renderer_no_sens, text=0)
|
2017-01-11 18:23:08 +01:00
|
|
|
treeview.append_column(column)
|
2012-11-01 14:23:49 +01:00
|
|
|
|
|
|
|
column = Gtk.TreeViewColumn('\'sensitive\' True',
|
|
|
|
renderer, text=1)
|
2017-01-11 18:23:08 +01:00
|
|
|
treeview.append_column(column)
|
2012-11-01 14:23:49 +01:00
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
scrolled.add(treeview)
|
|
|
|
self.pack_start(scrolled, True, True, 0)
|
2012-11-01 14:23:49 +01:00
|
|
|
|
|
|
|
self.show_all()
|
|
|
|
|
2017-01-05 01:02:26 +01:00
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
box = MyBox()
|
|
|
|
test.pack_start(box, True, True, 0)
|
|
|
|
box.show()
|
2012-11-01 14:23:49 +01:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
common.main(test)
|