本文整理汇总了Python中ttk.Treeview.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Treeview.__init__方法的具体用法?Python Treeview.__init__怎么用?Python Treeview.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ttk.Treeview
的用法示例。
在下文中一共展示了Treeview.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import __init__ [as 别名]
def __init__(self, *args, **kwargs):
# Only a single stack frame can be selected at a time.
kwargs['selectmode'] = 'browse'
Treeview.__init__(self, *args, **kwargs)
self.locals = self.insert(
'', 'end', ':builtins:',
text='builtins',
open=False,
)
self.globals = self.insert(
'', 'end', ':globals:',
text='globals',
open=False,
)
self.locals = self.insert(
'', 'end', ':locals:',
text='locals',
open=True,
)
self['columns'] = ('value',)
self.column('#0', width=150, anchor='w')
self.column('value', width=200, anchor='w')
self.heading('#0', text='Name')
self.heading('value', text='Value')
示例2: __init__
# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import __init__ [as 别名]
def __init__(self, parent, model):
Treeview.__init__(self, parent, columns=["COL0", "COL1"], selectmode="browse")
self.heading(0, text="Number")
self.heading(1, text="Text")
self["show"] = "headings"
self.counter = 0
self.bind("<<TreeviewSelect>>", self.on_select)
self.model = model
self.model.add_listener(self.on_model)
示例3: __init__
# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import __init__ [as 别名]
def __init__(self, gesture, master=None, yscrollcommand=None):
self.gesture = gesture
Treeview.__init__(self, master=master, columns=self.generate_columns(), yscrollcommand=yscrollcommand)
self.setup_column_headers()
self.populate_list()
self.pack(fill="both", expand="yes")
示例4: __init__
# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import __init__ [as 别名]
def __init__(self, parent, timeEntries):
columns = ("project", "start", "stop", "duration")
Treeview.__init__(self, parent, columns=columns)
for col in columns:
self.heading(col, text=col, command=lambda: self.sort_column(col, False))
[self.insertTimeEntry(e) for e in timeEntries.values()]
self.sort_column("start", True)
示例5: __init__
# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import __init__ [as 别名]
def __init__(self, data, master=None):
Treeview.__init__(self, master=master, columns=["friendly_name", "status"])
self.data = data
self.heading("#0", text="Port", anchor="w")
self.column("#0", width = 150)
self.heading("friendly_name", text="Name", anchor="w")
self.column("friendly_name", width = 250)
self.heading("status", text="Status", anchor="w")
self.column("status", width = 100)
self.bind("<<TreeviewSelect>>", self.update_status_button)
midi.init()
self.populate_list()
self.pack(fill="both", expand="yes")