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


Python TreeView.size_hint方法代码示例

本文整理汇总了Python中kivy.uix.treeview.TreeView.size_hint方法的典型用法代码示例。如果您正苦于以下问题:Python TreeView.size_hint方法的具体用法?Python TreeView.size_hint怎么用?Python TreeView.size_hint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kivy.uix.treeview.TreeView的用法示例。


在下文中一共展示了TreeView.size_hint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getTreeViewAsFiles

# 需要导入模块: from kivy.uix.treeview import TreeView [as 别名]
# 或者: from kivy.uix.treeview.TreeView import size_hint [as 别名]
 def getTreeViewAsFiles(self):
     try:
         tv = TreeView(hide_root=True)
         tv.size_hint = 1, None
         tv.bind(minimum_height = tv.setter('height'))
         
         for key in self.config_files:
             newnode = tv.add_node(TreeViewLabel(text=self.config_files[key].filename, font_size=self.label_font_size, color=self.filename_label_color))
             
             for child_filename in self.config_files[key].child_files:
                 self._addFileNodeToFileTreeView(tv, newnode, self.config_files[key].child_files[child_filename])
                 
             for configkey in self.config_files[key].config:
                 if isinstance(self.config_files[key].config[configkey], dict):
                     self._addDictNodeToFileTreeView(tv, newnode, configkey, self.config_files[key].config[configkey])
                 else:
                     tv.add_node(TreeViewLabel(text=str(configkey) + ':' + str(self.config_files[key].config[configkey]), font_size=self.label_font_size, color=self.key_label_color), newnode)
                             
         scv = ScrollView(pos = (0, 0), bar_width = 10)
         scv.add_widget(tv)
         return scv
     except:
         e = sys.exc_info()[0]
         self.log.exception("Error: %s" % e )
         raise
开发者ID:missionpinball,项目名称:mpf-wizard,代码行数:27,代码来源:mpf_wizard_ui.py

示例2: build

# 需要导入模块: from kivy.uix.treeview import TreeView [as 别名]
# 或者: from kivy.uix.treeview.TreeView import size_hint [as 别名]
 def build(self):
     #for i in range(30):
     #    btn = Button(text=str(i), size=(480, 40),
     #                 size_hint=(None, None))
     #    layout.add_widget(btn)
     tv = TreeView(root_options=dict(text='Tree One'), hide_root=True, indent_level=4)
     tv.size_hint = 1, None
     tv.bind(minimum_height = tv.setter('height'))
     populate_tree_view(tv)
     root = ScrollView(pos = (0, 0))
     root.add_widget(tv)
     return root
开发者ID:MartenButter,项目名称:Miniproject,代码行数:14,代码来源:TreeView.py

示例3: AddAsset

# 需要导入模块: from kivy.uix.treeview import TreeView [as 别名]
# 或者: from kivy.uix.treeview.TreeView import size_hint [as 别名]
 def AddAsset(self):
     """show the add asset dialog"""
     try:
         popup = Popup(title="select asset")
         popup.size_hint = (0.8,0.8)
         tv = TreeView(root_options=dict(text='Tree One'), hide_root=True, indent_level=4)
         tv.size_hint = 1, None
         tv.bind(minimum_height = tv.setter('height'))
         tv.load_func = self.populateTreeNode
         tv.bind(selected_node=self.on_assetSelected)
         root = ScrollView(pos = (0, 0))
         root.add_widget(tv)
         popup.add_widget(root)
         popup.open()
     except Exception as e:
         showError(e)
开发者ID:ATT-JBO,项目名称:ATTBrokerMonitor,代码行数:18,代码来源:main.py

示例4: getMergedTreeView

# 需要导入模块: from kivy.uix.treeview import TreeView [as 别名]
# 或者: from kivy.uix.treeview.TreeView import size_hint [as 别名]
    def getMergedTreeView(self):
        try:
            tv = TreeView(hide_root=True)
            tv.size_hint = 1, None
            tv.bind(minimum_height = tv.setter('height'))
            
            for key in self.config_files:
                merged_dict = self.config_files[key].get_merged_config()
            
            for key in merged_dict:
                if isinstance(merged_dict[key], dict):
                    newnode = tv.add_node(TreeViewLabel(text=str(key), font_size=self.label_font_size, color=self.key_label_color))
                    self._addNodeToMergedTreeView(tv, newnode, merged_dict[key])
                else:
                    newnode = tv.add_node(TreeViewLabel(text=str(key) + ':' + str(merged_dict[key]), font_size=self.label_font_size, color=self.key_label_color))
            
            scv = ScrollView(pos = (0, 0), bar_width = 10)
            scv.add_widget(tv)
            return scv

        except:
            e = sys.exc_info()[0]
            self.log.exception("Error: %s" % e )
            raise
开发者ID:missionpinball,项目名称:mpf-wizard,代码行数:26,代码来源:mpf_wizard_ui.py


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