本文整理汇总了Python中dtk.ui.treeview.TreeView.set_child_visible方法的典型用法代码示例。如果您正苦于以下问题:Python TreeView.set_child_visible方法的具体用法?Python TreeView.set_child_visible怎么用?Python TreeView.set_child_visible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtk.ui.treeview.TreeView
的用法示例。
在下文中一共展示了TreeView.set_child_visible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plugin_widget
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import set_child_visible [as 别名]
def plugin_widget(self):
self.__get_devices()
plugin_box = gtk.VBox()
adapter_box = gtk.HBox(spacing = 5)
adapter_image = ImageBox(app_theme.get_pixbuf("bluetooth/enable_open.png"))
adapter_label = self.__setup_label(_("Adapter"))
adapter_toggle = self.__setup_toggle()
if self.my_bluetooth.adapter:
adapter_toggle.set_active(self.my_bluetooth.adapter.get_powered())
if self.my_bluetooth.adapter.get_powered():
self.tray_icon.set_icon_theme("enable")
else:
self.tray_icon.set_icon_theme("enable_disconnect")
adapter_toggle.connect("toggled", self.__adapter_toggled)
separator_align = self.__setup_align(padding_bottom = 0)
separator = self.__setup_separator()
separator_align.add(separator)
'''
devices treeview
'''
device_treeview = TreeView()
device_separator_align = self.__setup_align()
device_separator = self.__setup_separator()
device_separator_align.add(device_separator)
device_count = len(self.device_items)
if device_count:
device_treeview.delete_all_items()
device_treeview.add_items(self.device_items)
device_treeview.set_size_request(self.width, device_count * DeviceItem.ITEM_HEIGHT)
else:
device_treeview.set_child_visible(False)
device_separator_align.set_size_request(-1, 0)
device_separator_align.set_child_visible(False)
'''
select button
'''
select_button_align = self.__setup_align()
select_button = SelectButton(_("Advanced options..."),
font_size = 10,
ali_padding = 5)
select_button.set_size_request(self.width, 25)
select_button.connect("clicked", self.__bluetooth_selected) # I don't know why, but replacing "button-press-event" with
select_button_align.add(select_button) # clicked really works...
adapter_box.pack_start(adapter_image, False, False)
adapter_box.pack_start(adapter_label, False, False)
adapter_box.pack_start(adapter_toggle, False, False)
plugin_box.pack_start(adapter_box, False, False)
plugin_box.pack_start(separator_align, False, False)
plugin_box.pack_start(device_treeview, False, False)
plugin_box.pack_start(device_separator_align, False, False)
plugin_box.pack_start(select_button_align, False, False)
return plugin_box