本文整理汇总了Python中dtk.ui.treeview.TreeView.visible_highlight方法的典型用法代码示例。如果您正苦于以下问题:Python TreeView.visible_highlight方法的具体用法?Python TreeView.visible_highlight怎么用?Python TreeView.visible_highlight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtk.ui.treeview.TreeView
的用法示例。
在下文中一共展示了TreeView.visible_highlight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TreeView
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import visible_highlight [as 别名]
# Set application icon.
application.set_icon(os.path.join(get_current_dir(__file__), "icon.ico"))
# Set application preview pixbuf.
application.set_skin_preview(os.path.join(get_current_dir(__file__), "frame.png"))
# Add titlebar.
application.add_titlebar(
["theme", "max", "min", "close"],
os.path.join(get_current_dir(__file__), "logo.png"),
"TreeView demo",
"TreeView demo",
)
# Add TreeView.
treeview = TreeView()
treeview.add_items(map(TextItem, ["Node1", "Node2", "Node3"]))
treeview.visible_items[0].add_items(map(TextItem, ["Node1 - SubNode1", "Node1 - SubNode2", "Node1 - SubNode3"]))
treeview.visible_items[1].add_items(map(TextItem, ["Node2 - SubNode1", "Node2 - SubNode2", "Node2 - SubNode3"]))
treeview.visible_items[2].add_items(map(TextItem, ["Node3 - SubNode1", "Node3 - SubNode2", "Node3 - SubNode3"]))
treeview_align = gtk.Alignment()
treeview_align.set(0.5, 0.5, 1, 1)
treeview_align.set_padding(0, 2, 2, 2)
treeview_align.add(treeview)
application.main_box.pack_start(treeview_align)
application.window.connect("show", lambda w: treeview.visible_highlight())
application.run()