本文整理汇总了Python中ttk.Treeview类的典型用法代码示例。如果您正苦于以下问题:Python Treeview类的具体用法?Python Treeview怎么用?Python Treeview使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Treeview类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
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')
开发者ID:adamchainz,项目名称:bugjar,代码行数:28,代码来源:widgets.py
示例2: selection_set
def selection_set(self, node):
"""Node names on the breakpoint tree are the filename.
On Windows, this requires escaping, because backslashes
in filenames cause problems with Tk.
"""
Treeview.selection_set(self, self._nodify(node))
开发者ID:adamchainz,项目名称:bugjar,代码行数:7,代码来源:widgets.py
示例3: __init__
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)
开发者ID:petrblahos,项目名称:modellerkit,代码行数:9,代码来源:tkl.py
示例4: __init__
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")
开发者ID:bnhymn,项目名称:jester,代码行数:9,代码来源:gesture.py
示例5: __init__
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)
开发者ID:ramblex,项目名称:lite-toggl,代码行数:10,代码来源:time_entry_list_widget.py
示例6: initComponents
def initComponents(self):
"""
GUI components initialization
"""
self.buttons = {}
frame1 = Frame(self)
frame1.place(relx=0.01, rely=0.03, width=600, height=30)
self.accountLabel = Label(frame1, text='accStatus')
self.accountLabel.place(x=0, width=80, height=30)
self.buttons['logout'] = Button (frame1, text="Logout")
self.buttons['logout'].place(x=85, height=24, width=80)
self.buttons['about'] = Button (frame1, text="About")
self.buttons['about'].place(x=170, height=24, width=80)
frame2 = Frame(self)
frame2.place(relx=0.01, rely=0.1, width=600, height=30)
self.buttons['new'] = Button (frame2, text="New")
self.buttons['new'].place(x=0, height=24, width=80)
self.buttons['edit'] = Button (frame2, text="Edit")
self.buttons['edit'].place(x=85, height=24, width=80)
self.buttons['delete'] = Button (frame2, text="Delete")
self.buttons['delete'].place(x=170, height=24, width=80)
self.buttons['find'] = Button (frame2, text="Find")
self.buttons['find'].place(x=255, height=24, width=80)
frame3 = Frame(self)
frame3.place(relx=0.01, rely=0.93, width=600, height=30)
self.buttons['prev'] = Button (frame3, text="Prev")
self.buttons['prev'].place(x=0, y=0, height=27, width=67)
self.pageLabel = Label(frame3, text='pageStatus')
self.pageLabel.place(x=85, width=80, height=30)
self.buttons['next'] = Button (frame3, text="Next")
self.buttons['next'].place(x=170, y=0, height=27, width=67)
self.frame = Frame (self)
self.frame.place(relx=0.01, rely=0.16, relheight=0.75, relwidth=0.98)
self.frame.configure(relief=GROOVE)
self.frame.configure(borderwidth="2")
self.frame.configure(relief="groove")
self.frame.grid_columnconfigure(0, weight=1)
self.frame.grid_rowconfigure(0, weight=1)
container = self.frame
tree = Treeview(container, columns=self.tree_columns, show="headings", selectmode='browse')
self.tree = tree
hsb = Scrollbar(container, orient="horizontal", command=self.tree.xview)
self.tree.configure(xscrollcommand=hsb.set)
# self.tree.grid(column=0, row=0, sticky='nsew', in_=container)
self.tree.pack()
hsb.grid(column=0, row=1, sticky='ew')
container.grid_columnconfigure(0, weight=1)
container.grid_rowconfigure(0, weight=1)
tree.grid(column=0, row=0, sticky='nsew')
for col in self.tree_columns:
self.tree.heading(col, text=col.title())
开发者ID:DevInCube,项目名称:VARANTeamProject,代码行数:51,代码来源:DataForm.py
示例7: __init__
def __init__(self, controller):
self.controller = controller
self.currIndex = 0
# initialize the GUI
self.app = Tk()
self.app.title('Jack Magee\'s Pub')
self.tree = Treeview(self.app, height=30)
# name the tree columns, not sure if they have to be named numbers but that's how the example did it
self.tree["columns"]=("one", "two", "three", "four")
# set the column widths
self.tree.column("one", width=200)
self.tree.column("two", width=300)
self.tree.column("three", width=200)
self.tree.column("four", width=200)
# set the column headings
self.tree.heading("#0", text= "ID")
self.tree.heading("one", text="Name")
self.tree.heading("two", text="Order")
self.tree.heading("three", text="Price")
self.tree.heading("four", text="Respond (double-click)")
self.tree.pack()
# register handler for double-clicks
self.tree.bind("<Double-1>", self.OnDoubleClick)
开发者ID:dnav6987,项目名称:PubApp,代码行数:31,代码来源:GUI.py
示例8: initUI
def initUI(self):
self.entries_found = []
self.parent.title("Search your command cards")
self.style = Style()
self.style.theme_use("default")
self.pack()
self.input_title = Label(self, text="Enter your command below")
self.input_title.grid(row=0, columnspan=2)
self.input_box = Entry(self, width=90)
self.input_box.grid(row=1, column=0)
self.input_box.focus()
self.input_box.bind("<Key>", self.onUpdateSearch)
self.search_btn = Button(self, text="Search", command=self.onSearch)
self.search_btn.grid(row=1, column=1)
self.output_box = Treeview(self, columns=("Example"))
ysb = Scrollbar(self, orient='vertical', command=self.output_box.yview)
xsb = Scrollbar(self, orient='horizontal', command=self.output_box.xview)
self.output_box.configure(yscroll=ysb.set, xscroll=xsb.set)
self.output_box.heading('Example', text='Example', anchor='w')
self.output_box.column("#0",minwidth=0,width=0, stretch=NO)
self.output_box.column("Example",minwidth=0,width=785)
self.output_box.bind("<Button-1>", self.OnEntryClick)
self.output_box.grid(row=3, columnspan=2)
self.selected_box = Text(self, width=110, height=19)
self.selected_box.grid(row=4, columnspan=2)
self.gotoadd_btn = Button(self, text="Go to Add", command=self.onGoToAdd)
self.gotoadd_btn.grid(row=5)
开发者ID:angelalonso,项目名称:comm,代码行数:30,代码来源:comm.py
示例9: _create_treeview
def _create_treeview(self, parent):
f = Frame(parent)
#f.pack(side=TOP, fill=BOTH, expand=Y)
f.grid(row=0, column=0, sticky=NSEW, columnspan=3)
# create the tree and scrollbars
self.dataCols = ('fullpath', 'type', 'status')
self.tree = Treeview(columns=self.dataCols,
displaycolumns='status')
ysb = Scrollbar(orient=VERTICAL, command= self.tree.yview)
xsb = Scrollbar(orient=HORIZONTAL, command= self.tree.xview)
self.tree['yscroll'] = ysb.set
self.tree['xscroll'] = xsb.set
# setup column headings
self.tree.heading('#0', text='Directory Structure', anchor=W)
self.tree.heading('status', text='Status', anchor=W)
self.tree.column('status', stretch=0, width=100)
# add tree and scrollbars to frame
self.tree.grid(in_=f, row=0, column=0, sticky=NSEW)
ysb.grid(in_=f, row=0, column=1, sticky=NS)
xsb.grid(in_=f, row=1, column=0, sticky=EW)
# set frame resizing priorities
f.rowconfigure(0, weight=1)
f.columnconfigure(0, weight=1)
# action to perform when a node is expanded
self.tree.bind('<<TreeviewOpen>>', self._update_tree)
self.tree.bind("<Double-1>", self.OnDoubleClick)
开发者ID:tdengg,项目名称:pylastic,代码行数:33,代码来源:main.py
示例10: fill
def fill(self):
super(self.__class__, self).fill()
#Basisvelden
self.identry = EntryField(self.veldenFrame, 'Projectnummer', row=0)
self.naamentry = EntryField(self.veldenFrame, 'Projectnaam', row=1)
self.jaarentry = EntryField(self.veldenFrame, 'Jaar', row=2)
self.budgetentry = EntryField(self.veldenFrame, 'Budget', row=3)
self.keywordLabel = Label(self.veldenFrame, text='Trefwoorden:')
self.keywordLabel.grid(row=4, column=0, sticky=W)
self.keywordText = Text(self.veldenFrame, relief=SUNKEN, wrap=WORD, width=60, height=3)
self.keywordText.grid(row=4, column=1, sticky=W)
#Partners
self.partnersLabel = Label(self.veldenFrame, text='Relaties:')
self.partnersLabel.grid(row=5, column=0)
self.partnersFrame = Frame(self.veldenFrame)
self.partnersFrame.grid(row=5, column=1, sticky=W+E)
self.partnersListBox = Treeview(self.partnersFrame, columns=('Relatie', 'Rol'), height=3, show='headings', selectmode=BROWSE)
self.partnersListBox.grid(row=0, column=0, sticky=W+E)
self.partnersKnopFrame = Frame(self.veldenFrame)
self.partnersKnopFrame.grid(row=6, column=1, sticky=E)
self.pScrollbar = Scrollbar(self.partnersFrame)
self.pScrollbar.grid(row=0, column=1, sticky=N+S+E)
self.partnersListBox.config(yscrollcommand=self.pScrollbar.set)
self.pScrollbar.config(command=self.partnersListBox.yview)
self.partnersToevoegenKnop = Button(self.partnersKnopFrame, text='Toevoegen...', command=self.partnerToevoegen)
self.partnersToevoegenKnop.grid()
self.partnersVerwijderenKnop = Button (self.partnersKnopFrame, text='Verwijderen', command=self.partnerVerwijderen)
self.partnersVerwijderenKnop.grid(row=0, column=1)
self.partnersListBox.bind('<<TreeviewSelect>>', self.nieuwePartnerSelectie)
#Bestanden
self.bestandenHoofdFrame = Frame(self.resultaatframe)
self.bestandenHoofdFrame.grid(row=2)
self.bestandenLabel = Label(self.bestandenHoofdFrame, text='Bestanden:')
self.bestandenLabel.grid(row=7, column=0, sticky=W)
self.bestandenFrame = Frame(self.bestandenHoofdFrame)
self.bestandenFrame.grid(row=7, column=1, sticky=W+E)
self.bestandenListBox = Listbox(self.bestandenFrame, selectmode=EXTENDED, width=50, height=10)
self.bestandenListBox.grid(row=0, column=0, sticky=W+E)
self.bScrollbar = Scrollbar(self.bestandenFrame)
self.bScrollbar.grid(row=0, column=1, sticky=N+S+E)
self.bestandenListBox.config(yscrollcommand=self.bScrollbar.set)
self.bScrollbar.config(command=self.bestandenListBox.yview)
self.bestandenKnopFrame = Frame(self.bestandenHoofdFrame)
self.bestandenKnopFrame.grid(row=8, column=1, sticky=E)
self.bestandenToevoegKnop = Button(self.bestandenKnopFrame, text='Bestanden toevoegen...', command=self.bestandenToevoegen)
self.bestandenToevoegKnop.grid(row=0, column=0, sticky=E)
self.mapToevoegenKnop = Button(self.bestandenKnopFrame, text='Map toevoegen...', command=self.mapToevoegen)
self.mapToevoegenKnop.grid(row=0, column=1, sticky=E)
self.bestandenOphaalKnop = Button(self.bestandenKnopFrame, text='Ophalen...', command=self.bestandenOphalen)
self.bestandenOphaalKnop.grid(row=0, column=2, sticky=E)
self.bestandenVerwijderKnop = Button(self.bestandenKnopFrame, text='Verwijderen', command=self.bestandenVerwijderen)
self.bestandenVerwijderKnop.grid(row=0, column=3, sticky=E)
self.pollBestandenLijst()
self.curid=-1
开发者ID:Lleuad,项目名称:PCMbv,代码行数:59,代码来源:projectvenster.py
示例11: createQSOView
def createQSOView(self, master):
self.qsoviewScrollbar = Scrollbar(master)
self.qsoview = Treeview(master, show=('headings'),
yscrollcommand=self.qsoviewScrollbar.set)
self.qsoviewfields = {'day': {'name': "D", 'width': 10},
'month': {'name': "M", 'width': 10},
'year': {'name': "Y", 'width': 20},
'timeon': {'name': "Time", 'width': 30},
'timeoff': {'name': "Timeoff", 'width': 30},
'band': {'name': "Band", 'width': 20},
'freq': {'name': "Frequency", 'width': 50},
'mode': {'name': "Mode", 'width': 25},
'call': {'name': "Call", 'width': 50},
'srst': {'name': "S RST", 'width': 25},
'rrst': {'name': "R RST",'width': 25},
'name': {'name': "Name",'width': 40},
'grid': {'name': "Gridsquare",'width': 30},
'iota': {'name': "IOTA", 'width': 30},
'qsls': {'name': "Q S",'width': 25},
'qsls_date': {'name': "Q S D",'width': 50},
'qslr': {'name': "Q R",'width': 25},
'qslr_date': {'name': "Q R D",'width': 50},
'lotw_qsls': {'name': "LQ S",'width': 25},
'lotw_qsls_date': {'name': "LQ S D",'width': 50},
'lotw_qslr': {'name': "LQ R",'width': 25},
'lotw_qslr_date': {'name': "LQ R D",'width': 50}}
self.qsoviewdisplayesfields = ('day', 'month', 'year', 'timeon',
'band', 'freq', 'mode', 'call',
'srst', 'rrst', 'name', 'grid',
'iota', 'qsls', 'qsls_date', 'qslr',
'qslr_date', 'lotw_qsls', 'lotw_qsls_date', 'lotw_qslr',
'lotw_qslr_date')
self.qsoview["columns"] = self.qsoviewfields.keys()
self.qsoview["displaycolumns"] = self.qsoviewdisplayesfields
self.qsoview.column(0, width=40)
for columnname, data in self.qsoviewfields.items():
# set columnwidth for QSOView
self.qsoview.column(columnname, width=data['width'])
# set QSOView headers
self.qsoview.heading(columnname, text=data['name'])
for i in range(400):
self.qsoview.insert('', 'end', str(i), values=(str(i), 'bar'+str(i)))
self.qsoviewScrollbar.config(command=self.qsoview.yview)
self.qsoviewScrollbar.grid(column=1, row=0, sticky=(N,S))
self.qsoview.grid(column=0, row=0, sticky=(N,S,E,W))
master.columnconfigure(0, weight=1)
master.rowconfigure(0, weight=1)
开发者ID:richtma,项目名称:snakeLog,代码行数:59,代码来源:snakeLog.py
示例12: __init__
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")
开发者ID:bnhymn,项目名称:jester,代码行数:17,代码来源:midi.py
示例13: left_side
def left_side(self, master):
self.nombre = Entry(master, justify = CENTER, bd = 3, font = ('Ravie', 11), textvariable = self.NameVar)
self.nombre.pack(side = TOP, fill = X)
self.nombre.bind("<Key>", self.Enter)
self.texto = Entry(master, justify = CENTER, bd = 3, font = ('Ravie', 11), textvariable = self.TextVar)
self.texto.pack(side = TOP, fill = X)
self.texto.bind("<Key>", self.Enter)
self.tag = Entry(master, justify = CENTER, bd = 3, font = ('Ravie', 11), textvariable = self.TagsVar)
self.tag.pack(side = TOP, fill = X)
self.tag.bind("<Key>", self.Enter)
self.tree = Treeview(master)
self.tree.pack(side = LEFT, expand = YES, fill = BOTH)
self.tree.bind("<Double-1>", self.OnDoubleClick)
开发者ID:ErmantrautJoel,项目名称:Python,代码行数:13,代码来源:Interfaz+Biblico.py
示例14: __init__
def __init__(self, master, xml=None, heading_text=None, heading_anchor=None, padding=None, cursor=None, takefocus=None, style=None):
Frame.__init__(self, master, class_="XML_Viwer")
self._vsb = Scrollbar(self, orient=VERTICAL)
self._hsb = Scrollbar(self, orient=HORIZONTAL)
kwargs = {}
kwargs["yscrollcommand"] = lambda f, l: autoscroll(self._vsb, f, l)
kwargs["xscrollcommand"] = lambda f, l: autoscroll(self._hsb, f, l)
if style is not None:
kwargs["style"] = style
if padding is not None:
kwargs["padding"] = padding
if cursor is not None:
kwargs["cursor"] = cursor
if takefocus is not None:
kwargs["takefocus"] = takefocus
self._treeview = Treeview(self, **kwargs)
if heading_text is not None:
if heading_anchor is not None:
self._treeview.heading("#0", text=heading_text, anchor=heading_anchor)
else:
self._treeview.heading("#0", text=heading_text)
self._treeview.bind("<<TreeviewOpen>>", self._on_open)
self._treeview.bind("<<TreeviewClose>>", self._on_close)
# Without this line, horizontal scrolling doesn't work properly.
self._treeview.column("#0", stretch= False)
self._vsb['command'] = self._treeview.yview
self._hsb['command'] = self._treeview.xview
self._treeview.grid(column=0, row=0, sticky=N+S+W+E)
self._vsb.grid(column=1, row=0, sticky=N+S)
self._hsb.grid(column=0, row=1, sticky=E+W)
self.grid_columnconfigure(0, weight=1)
self.grid_rowconfigure(0, weight=1)
self._element_tree = None
self._item_ID_to_element = {}
if xml is not None:
self.parse_xml(xml)
开发者ID:jacob-carrier,项目名称:code,代码行数:51,代码来源:recipe-580752.py
示例15: initUI
def initUI(self):
self.columnconfigure(0, weight=0)
self.columnconfigure(1, weight=0)
self.columnconfigure(2, weight=1)
self.columnconfigure(3, weight=1)
self.rowconfigure(0, weight=1)
self.commandFrame = Frame(self, background="white")
self.commandFrame.grid(row=0, column=0, columnspan=5, sticky=W + E)
self.commandFrame.columnconfigure(1, weight=1)
self.btnCommand = Button(self.commandFrame, text="Run")
self.btnCommand.grid(row=0, column=0)
self.strCommand = StringVar()
self.entCommand = Entry(self.commandFrame, textvariable=self.strCommand)
self.entCommand.grid(row=0, column=1, sticky=W + E)
self.lstMacro = Listbox(self)
self.lstMacro.grid(row=1, column=0, sticky=N + S + W + E)
self.treeview = Treeview(self, columns=("Angle"), displaycolumns="#all", selectmode="browse")
self.treeview.grid(row=1, column=1, columnspan=4, sticky=N + S + W + E)
self.treeScrollbar = Scrollbar(self)
self.treeScrollbar.grid(row=1, column=5, sticky=N + S)
self.treeview.config(yscrollcommand=self.treeScrollbar.set)
self.treeScrollbar.config(command=self.treeview.yview)
self.btnFrame = Frame(self, background="white")
self.btnFrame.grid(row=2, column=0, columnspan=5, sticky=W + E)
self.btnRun = Button(self.btnFrame, text="Run", command=self.runMacro)
self.btnRun.grid(row=0, column=0)
self.btnStop = Button(self.btnFrame, text="Stop")
self.btnStop.grid(row=0, column=1)
self.btnSaveMacro = Button(self.btnFrame, text="Save Macro", command=self.saveMacro)
self.btnSaveMacro.grid(row=0, column=2)
self.btnDeleteMacro = Button(self.btnFrame, text="Delete Macro")
self.btnDeleteMacro.grid(row=0, column=3)
self.btnDeleteState = Button(self.btnFrame, text="Delete State")
self.btnDeleteState.grid(row=0, column=4)
开发者ID:demetraux,项目名称:Octopod,代码行数:46,代码来源:gui.py
示例16: create_file_treeview
def create_file_treeview(self):
self.fileTreeView = Treeview(self.main_window)
self.fileTreeYScrollbar = Scrollbar(self.main_window, orient='vertical', command=self.fileTreeView.yview)
self.fileTreeXScrollbar = Scrollbar(self.main_window, orient='horizontal', command=self.fileTreeView.xview)
self.fileTreeView.configure(yscroll=self.fileTreeYScrollbar.set, xscroll=self.fileTreeXScrollbar.set)
self.fileTreeView.grid(row=self.fileTreeRow, column=self.fileTreeCol, sticky=NS, rowspan=3)
self.fileTreeYScrollbar.grid(row=self.fileTreeRow, column=self.fileTreeScrollbarCol, sticky=NS, rowspan=3)
self.fileTreeXScrollbar.grid(row=self.horizontalScrollbarRow, column=self.fileTreeCol, sticky=EW)
self.fileTreeView.tag_configure('red', background=self.redColor)
self.fileTreeView.tag_configure('green', background=self.greenColor)
self.fileTreeView.tag_configure('yellow', background=self.yellowColor)
# hide it until needed
self.fileTreeView.grid_remove()
self.fileTreeYScrollbar.grid_remove()
self.fileTreeXScrollbar.grid_remove()
开发者ID:yebrahim,项目名称:pydiff,代码行数:18,代码来源:mainwindow_ui.py
示例17: __init__
def __init__(self, app, printer, settings, logger, *arg):
self.app = app
self.printer = printer
self.settings = settings
self.logger = logger
layers = self.app.gcodeInfo.layerOrder
usage = self.app.gcodeInfo.filLayers
self.selection = None
Toplevel.__init__(self, app, *arg)
self.title("Layer by Layer Filament Usage")
self.protocol("WM_DELETE_WINDOW", self.doCancel)
f = Frame(self)
f.grid(row=1, column=1, rowspan=1, padx=10)
self.tree = Treeview(self, height=12, selectmode='browse')
self.sb = Scrollbar(self)
self.sb.config(command=self.tree.yview)
self.tree.config(yscrollcommand=self.sb.set)
ln = []
for l in layerinfo:
ln.append(l[0])
del ln[0]
self.tree.config(columns=ln)
for l in layerinfo:
self.tree.column(l[0], width=l[1], anchor=l[2])
self.tree.heading(l[0], text=l[3])
self.sb.pack(side=RIGHT, fill=Y)
self.tree.pack(side=LEFT, fill=BOTH, expand=1)
prev = 0.0
tl = layers[-1]
total = usage[tl]
for l in layers:
n = usage[l]
self.tree.insert('', 'end', text=l, values=("%7.3f" % (n-prev), "%9.3f" % n, "%9.3f" % (total-n)))
prev = n
开发者ID:jbernardis,项目名称:repraphost,代码行数:43,代码来源:reports.py
示例18: createWidgets
def createWidgets(self):
"""Create all the initial widgets for this menu"""
"""Labels"""
lbl = Label(self, text="Select test below", justify=LEFT)
lbl.grid(row=self.TEXT_ROW, column=self.TEST_COL)
"""Tests"""
self.trv = Treeview(self, columns=("Status"), displaycolumns='#all')
for test in self.tests:
treeviewInsertTest(self.trv, test)
self.trv.column('#0', width=100)
self.trv.heading('#0', text="Test")
self.trv.heading('Status', text='Status')
self.trv.grid(column=self.TEST_COL, row=self.TREEVIEW_ROW,
columnspan=2)
"""Buttons"""
self.btnOK = Button(self, text="OK", command=self.launchTest)
self.btnOK.grid(row=self.BUTTON_ROW, column=0)
self.btnQuit = Button(self, text="Quit", command=self.quit)
self.btnQuit.grid(row=self.BUTTON_ROW, column=1)
开发者ID:cjenkin2,项目名称:iMX53-GUI-Hardware-Test,代码行数:24,代码来源:mainMenu.py
示例19: __init__
def __init__(self, parent, controller):
Frame.__init__(self, parent)
global info, tree
#VARIABLES
info = IntVar()
#WIDGETS
#========================= HEADER ===========================
self.header = Label(self, text="ADMINISTRADOR DE DOCUMENTOS", font="bold")
self.header.pack(pady=20, side=TOP)
#========================= WRAPPER 1 ===========================
self.wrapper = Frame (self)
self.wrapper.pack(side=LEFT, fill=Y)
#======================== DOCUMENTOS DE ========================
self.f0 = Frame(self.wrapper)
self.f0.pack(pady=5,fill=X)#------------------------------------
self.lf1 = LabelFrame(self.f0, text="Documentos de")#---------->
self.f1 = Frame(self.lf1)
self.f1.pack(pady=5, side=LEFT)
self.pR1 = Radiobutton(self.f1, text="Propietario", variable=info, value=1, command=select)
self.pR1.grid(row=0, column=0, sticky=W)
self.aR2 = Radiobutton (self.f1, text="Arrendatario", variable=info, value=2, command=select)
self.aR2.grid(row=1, column=0, sticky=W)
self.tR3 = Radiobutton (self.f1, text="Tercero", variable=info, value=3, command=select)
self.tR3.grid(row=2, column=0, sticky=W)
self.lf1.pack(side=LEFT)#<--------------------------------------
#====================== FECHAS DE BÚSQUEDA =====================
self.lf2 = LabelFrame(self.f0, text="Fechas de búsqueda")#------>
self.f2 = Frame(self.lf2)
self.f2.pack(pady=5)#---------------------------
self.deL = Label(self.f2, text='De:')
self.deL.pack(side=LEFT)
self.deCbx = Combobox(self.f2, width=32)
self.deCbx.set('')
self.deCbx.pack(side=LEFT)
self.f3 = Frame(self.lf2)
self.f3.pack(pady=5)#---------------------------
self.hastaL = Label(self.f3, text='Hasta:')
self.hastaL.pack(side=LEFT)
self.hastaCbx = Combobox(self.f3, width=30)
self.hastaCbx.set('')
self.hastaCbx.pack(side=LEFT)
self.lf2.pack(side=LEFT, fill=X)#<---------------------------
#========================= WRAPPER 2 ===========================
self.wrapper2 = Frame (self.wrapper)
self.wrapper2.pack(pady=5,fill=X)
#========================= BENEFICIARIO ========================
self.box1 = Frame(self.wrapper2)
self.box1.pack(side=LEFT)
#---------------------------------------------------------------
self.f4 = Frame(self.box1)
self.f4.pack()
self.l1 = Label(self.f4, text="Beneficiario")
self.l1.pack()
tree = Treeview(self.f4, height=7, show="headings", columns=('col1','col2'))
tree.pack(side=LEFT, fill=X, expand=1)
tree.column('col1', width=100, anchor='center')
tree.column('col2', width=180, anchor='center')
tree.heading('col1', text='CC')
tree.heading('col2', text='Nombres')
self.scroll = Scrollbar(self.f4,orient=VERTICAL,command=tree.yview)
tree.configure(yscrollcommand=self.scroll.set)
self.f5 = Frame(self.box1)#----------------------------------
self.f5.pack()
self.lf3 = LabelFrame(self.f5, text="Factura Propietario")#---->
self.e1 = Entry(self.lf3, width=12).pack(side=LEFT)
#.........这里部分代码省略.........
开发者ID:einnerlink,项目名称:sbienes,代码行数:101,代码来源:admindocs.py
示例20: __init__
def __init__(self, parent, controller):
Frame.__init__(self, parent)
global docID, nombre, refbanco, tree, busqueda, info, delete
global e3
lupa = PhotoImage(file='img/lupa.png')
docID = StringVar()
nombre = StringVar()
refbanco = StringVar()
busqueda = StringVar()
info = IntVar()
#WIDGETS
#=========================== HEADER ============================
l0 = Label(self, text="BENEFICIARIOS", font="bold")
l0.pack(pady=20, side=TOP)
#=========================== WRAPPER ===========================
wrapper = Frame (self)
wrapper.pack(side=TOP, fill=Y)
#wrapper.pack(side=LEFT, fill=Y) #UBICA EL FORM A LA IZQ
f1 = Frame(wrapper)
f1.pack(pady=5, fill=X)#-----------------------------------
l1 = Label (f1, text="CC/Nit: ")
l1.pack(side=LEFT)
e1 = Entry (f1, textvariable=docID, width=20)
e1.pack(side=LEFT)
e1.bind("<KeyRelease>", caps)
e1.focus_set()
f2 = Frame(wrapper)
f2.pack(pady=5, fill=X)#-----------------------------------
l2 = Label (f2, text="Nombre: ")
l2.pack(side=LEFT)
e2 = Entry (f2, textvariable=nombre, width=60)
e2.pack(side=LEFT, fill=X, expand=1)
e2.bind("<KeyRelease>", caps)
f3 = Frame(wrapper)
f3.pack(pady=5, fill=X)#-----------------------------------
l3 = Label (f3, text="Referencia Bancaria: ")
l3.pack(side=LEFT)
e3 = Entry (f3, textvariable=refbanco, width=60)
e3.pack(side=LEFT, fill=X, expand=1)
e3.bind("<KeyRelease>", caps)
f4 = Frame(wrapper)
f4.pack(pady=5, fill=X)#-----------------------------------
b1 = Button (f4, text="Cargar", bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=cargar)
b1.pack(side=RIGHT)
b2 = Button (f4, text="Agregar", bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=agregar)
b2.pack(side=RIGHT)
#========================== TREEVIEW ===========================
f5 = Frame(wrapper)
f5.pack(pady=5, fill=X)#-----------------------------------
tree = Treeview(f5, show="headings", columns=('col1','col2'))
tree.pack(side=LEFT, fill=X, expand=1)
tree.column('col1', width=0, anchor='center')
tree.column('col2', width=150, anchor='w')
tree.heading('col1', text='CC/Nit')
tree.heading('col2', text='Nombre Completo')
scroll = Scrollbar(f5,orient=VERTICAL,command=tree.yview)
tree.configure(yscrollcommand=scroll.set)
f6 = Frame(wrapper)
f6.pack(pady=5, fill=X)#-----------------------------------
delete = Button (f6, text="Eliminar", bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=borrar)
delete.pack(side=RIGHT)
e4 = Entry(f6, textvariable=busqueda)
e4.pack(side=LEFT)
e4.bind("<KeyRelease>", caps)
b4 = Button(f6, text='BUSCAR', image=lupa, command=buscar)
b4.image = lupa
b4.pack(side=LEFT)
R1 = Radiobutton(f6, text="CC/nit", variable=info, value=1)
R1.pack(side=LEFT)
R2 = Radiobutton (f6, text="Nombre", variable=info, value=2)
R2.pack(side=LEFT)
info.set(1)
开发者ID:einnerlink,项目名称:sbienes,代码行数:99,代码来源:beneficiarios.py
注:本文中的ttk.Treeview类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论