本文整理汇总了Python中gobject.TYPE_BOOLEAN属性的典型用法代码示例。如果您正苦于以下问题:Python gobject.TYPE_BOOLEAN属性的具体用法?Python gobject.TYPE_BOOLEAN怎么用?Python gobject.TYPE_BOOLEAN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类gobject
的用法示例。
在下文中一共展示了gobject.TYPE_BOOLEAN属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new
# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import TYPE_BOOLEAN [as 别名]
def new(self):
self.treeHosts = self.get_widget('treeHosts')
self.treeStore = gtk.TreeStore( gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_OBJECT )
for x in self.terms:
self.treeStore.append( None, (False, x[0], x[1]) )
self.treeHosts.set_model( self.treeStore )
crt = gtk.CellRendererToggle()
crt.set_property('activatable', True)
crt.connect('toggled', self.on_active_toggled)
col = gtk.TreeViewColumn(_("Activar"), crt, active=0)
self.treeHosts.append_column( col )
self.treeHosts.append_column(gtk.TreeViewColumn(_("Host"), gtk.CellRendererText(), text=1 ))
self.get_widget("txtCommands").history = []
#-- Wcluster.new }
#-- Wcluster custom methods {
# Write your own methods here
示例2: __init__
# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import TYPE_BOOLEAN [as 别名]
def __init__(self):
self.xml = gtk.glade.XML(util.sibpath(__file__,"gladereactor.glade"))
d = {}
for m in reflect.prefixedMethods(self, "on_"):
d[m.im_func.__name__] = m
self.xml.signal_autoconnect(d)
self.xml.get_widget('window1').connect('destroy',
lambda w: self.stop())
self.servers = self.xml.get_widget("servertree")
sel = self.servers.get_selection()
sel.set_mode(gtk.SELECTION_SINGLE)
sel.connect("changed",
self.servers_selection_changed)
## argh coredump: self.servers_selection_changed(sel)
self.xml.get_widget('suspend').set_sensitive(0)
self.xml.get_widget('disconnect').set_sensitive(0)
# setup model, connect it to my treeview
self.model = gtk.ListStore(str, object, gobject.TYPE_BOOLEAN,
gobject.TYPE_BOOLEAN)
self.servers.set_model(self.model)
self.servers.set_reorderable(1)
self.servers.set_headers_clickable(1)
# self.servers.set_headers_draggable(1)
# add a column
for col in [
gtk.TreeViewColumn('Server',
gtk.CellRendererText(),
text=0),
gtk.TreeViewColumn('Reading',
gtk.CellRendererToggle(),
active=2),
gtk.TreeViewColumn('Writing',
gtk.CellRendererToggle(),
active=3)]:
self.servers.append_column(col)
col.set_resizable(1)
sup.__init__(self)