本文整理汇总了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
示例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
示例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)
示例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