当前位置: 首页>>代码示例>>Python>>正文


Python TreeView.set_child_visible方法代码示例

本文整理汇总了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
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:57,代码来源:tray_bluetooth_plugin.py


注:本文中的dtk.ui.treeview.TreeView.set_child_visible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。