本文整理汇总了Python中Tkinter.LabelFrame.pack方法的典型用法代码示例。如果您正苦于以下问题:Python LabelFrame.pack方法的具体用法?Python LabelFrame.pack怎么用?Python LabelFrame.pack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.LabelFrame
的用法示例。
在下文中一共展示了LabelFrame.pack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_components
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def _init_components(self):
self._panes = PanedWindow(self, orient='horizontal', sashrelief="raised")
self._panes.pack(expand=True, fill='both')
self._left_pane = Frame(self._panes, padx=10, pady=5)
self._right_pane = PanedWindow(self._panes)
self._panes.add(self._left_pane, sticky='n')
self._panes.add(self._right_pane)
self._group_select = GroupSelect(self._left_pane)
self._group_select.pack(expand=True, fill='x')
# spacer
Frame(self._left_pane, height=10).pack()
graph_controls = LabelFrame(self._left_pane, text="Graph options", padx=10, pady=5)
graph_controls.columnconfigure(1, weight=1)
graph_controls.pack(expand=True, fill='x')
self._show_graph_checkbutton = CheckBox(graph_controls, text='Show graph')
self._show_graph_checkbutton.select()
self._show_graph_checkbutton.grid(row=0, columnspan=2, sticky='w')
Label(graph_controls, text='Algorithm').grid(row=1, sticky='w')
self._graph_type = OptionList(graph_controls, values=MainWindow.GRAPH_TYPES.keys())
self._graph_type.config(width=15)
self._graph_type.grid(row=1, column=1, sticky='we')
# spacer
Frame(self._left_pane, height=10).pack()
self._go_button = Button(self._left_pane, text='Go', command=self._go)
self._go_button.pack()
示例2: Message
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
class Message(Show_style):
def __init__(self, master=None):
Show_style.__init__(self, master)
self.add_status()
self.create_widget()
self.pack_all()
def create_widget(self):
self.create_main_frame()
def create_main_frame(self):
self.main_labelframe = LabelFrame(self, text='消息中心')
self.main_list_item = (('业务编号',10),('客户编号',8),('客户名称',20),('发放日',10),('到期日',10),('贷款金额',5),('产品名称',10),('期限', 5),('利率',8), ('申请状态', 14))
self.main_list = MultiListbox(self.main_labelframe, self.main_list_item, height=22)
self.main_list.grid(padx=10, pady=10, row=0, column=0)
self.check_button = Button(self.main_labelframe, text='察看')
def check_func():
apply_information = self.get_mutilistbox_choose()
if not apply_information:
MessageBox('当前申请', '请先选中一个申请消息')
return
self.apply_information_toplevel = ApplyInformationToplevel(self, apply_information)
self.check_button['command'] = check_func
self.check_button.grid(pady=10, row=1, column=0)
def get_mutilistbox_choose(self):
now = self.main_list.curselection()
if not now:
return None
else:
print 'now', self.main_list.get(now)
number = self.main_list.get(now)[0]
#return const.apply_information_list[int(now[0])]
for apply_information in const.apply_information_list:
if apply_information[15] == number:
return apply_information
def refresh_mutilistbox(self):
self.main_list.delete(0, self.main_list.size())
self.add_item()
def add_item(self):
apply_list = show_apply_list()
for p in apply_list:
now_state = int(p[-1])
if now_state >= 5:
p[-1] = '审核通过'
elif now_state > int(const.user_type):
p[-1] = '等待上级审核'
elif now_state == int(const.user_type):
p[-1] = '等待当前用户审核'
elif now_state < int(const.user_type):
continue
self.main_list.insert(Tkinter.END, p)
def pack_all(self):
self.main_labelframe.pack()
示例3: callHelpdWindow
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def callHelpdWindow():
textvar='K-TAIL State Transition Software\nVersion:1.0\nAuthor:Lenz L Nerit\University:Victoria University of Wellington\n'
helpWind=Toplevel()
helpWind.resizable(width=FALSE, height=FALSE)
frame=ttk.Frame(helpWind)
frm=LabelFrame(frame,text='test')
frm.pack()
lbl=Label(frm,text="sampleStatus",width=10,bg='blue')
lbl.pack(fill=BOTH)
helpWind.mainloop()
示例4: specific_frame
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def specific_frame(gui, link):
# TODO: Handle resizing if there is too much information displayed.
res = wrap.get_class_grades(link)
main_frame = LabelFrame(gui, text=res["class_name"] + " - " + res["current_average"])
for sec in res["sections"]:
frame_name = sec["name"]
if sec["average"]:
frame_name += " - " + sec["average"]
temp_frame = LabelFrame(main_frame, text=frame_name, padx=20, pady=5)
for i, h in enumerate(sec["grades"]["headers"]):
Label(temp_frame, text=h).grid(row=1, column=i)
for i, r in enumerate(sec["grades"]["rows"]):
for j, c in enumerate(r):
Label(temp_frame, text=c).grid(row=i+2, column=j)
temp_frame.pack(padx=20, pady=5)
main_frame.pack(padx=10, pady=(0, 10))
示例5: overview_frame
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def overview_frame(gui):
def click_link(link):
gui.destroy()
specific_gui(link)
res = wrap.get_student_grades_overview()
frame = LabelFrame(gui, text=res["student_name"], padx=20, pady=10)
for i, t in enumerate(res["grades"]["headers"]):
Label(frame, text=str(t)).grid(row=0, column=i)
for i, r in enumerate(res["grades"]["rows"]):
for j, c in enumerate(r):
if isinstance(c, Link):
Button(frame, command=lambda l=c: click_link(l), text=str(c))\
.grid(row=i+1, column=j)
elif c:
Label(frame, text=str(c)).grid(row=i+1, column=j)
frame.pack(padx=10, pady=10)
gui.title(res["student_name"])
示例6: displayAxis
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def displayAxis(self, frame, axis, gmin, gmax, gtot):
labels = {'X': 'Width:', 'Y': 'Depth:', 'Z': 'Height:'}
f = LabelFrame(frame, text="%s Axis:" % axis)
f.pack(fill=X, pady=10, padx=10)
l = Label(f, text="Minimum:", width=12, justify=RIGHT)
l.grid(row=1, column=1, sticky=E)
l = Label(f, text="%8.3f" % gmin, justify=LEFT)
l.grid(row=1, column=2)
l = Label(f, text="Maximum:", width=12, justify=RIGHT)
l.grid(row=2, column=1, sticky=E)
l = Label(f, text="%8.3f" % gmax, justify=LEFT)
l.grid(row=2, column=2)
l = Label(f, text=labels[axis], width=12, justify=RIGHT)
l.grid(row=3, column=1, sticky=E)
l = Label(f, text="%8.3f" % gtot, justify=LEFT)
l.grid(row=3, column=2)
示例7: _init_components
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def _init_components(self):
self._panes = PanedWindow(self, orient='horizontal', sashrelief='raised')
self._panes.pack(expand=True, fill='both')
self._left_pane = Frame(self._panes, padx=2, pady=2)
self._right_pane = Frame(self._panes)
self._panes.add(self._left_pane, width=250)
self._panes.add(self._right_pane)
# group name
group_name_pane = LabelFrame(self._left_pane, text="Group", padx=10, pady=5)
group_name_pane.pack(fill='x')
self._group_name = GroupNameLabel(group_name_pane, self._group)
self._group_name.pack(expand=True, fill='both')
# group order
group_order_pane = LabelFrame(self._left_pane, text="Order", padx=10, pady=5)
group_order_pane.pack(fill='x')
self._group_order = IntegerContainer(group_order_pane, integer=self._group.order())
self._group_order.pack(expand=True, fill='both')
# apex
self._apex_pane = LabelFrame(self._left_pane, text="Apex", padx=10, pady=5)
self._apex_pane.pack(expand=True, fill='both')
self._apex_container = ApexListContainer(self._apex_pane, apex=self._group.apex())
self._apex_container.pack(expand=True, fill='both')
# graph controls
cocliques_frame = LabelFrame(self._left_pane, text="Cocliques", padx=10, pady=5)
cocliques_frame.pack(fill='x')
self._cocliques_button = Button(cocliques_frame, text="Calculate", command=self._show_cocliques)
self._cocliques_button.pack(anchor='nw')
self._cocliques_container = ListContainer(cocliques_frame)
self._cocliques_list = Listbox(self._cocliques_container)
self._cocliques_container.set_listbox(self._cocliques_list)
# Button(graph_controls, text='Group equivalent vertices').pack(anchor='nw')
# this is a button that show up instead of graph canvas if we uncheck 'Show graph' checkbox.
self._show_graph_button = Button(self._right_pane, text='Show graph',
command=self._show_graph_canvas)
self._graph_canvas = None
if self._show_graph:
self._show_graph_canvas()
else:
self._show_graph_button.pack()
示例8: updateRGB
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
updateRGB()
def v_sel(val):
print "v_sel(" + str(val) + ")"
selection = "V = " + str(v_var.get())
v_label.config(text = selection)
updateRGB()
tk = Tk()
tk.wm_title("Colour Demo")
canvas = Canvas(width=400, height=300, bg="#%02x%02x%02x" % (0, 0, 0))
canvas.pack()
rgbFrame = LabelFrame(tk, text="RGB")
rgbFrame.pack(fill="both", expand="yes")
r_var = IntVar()
r_scale = Scale(rgbFrame, variable = r_var, from_=0, to=255, showvalue=0, orient=HORIZONTAL, command=r_sel)
r_scale.pack()
r_label = Label(rgbFrame)
r_label.pack()
g_var = IntVar()
g_scale = Scale(rgbFrame, variable = g_var, from_=0, to=255, showvalue=0, orient=HORIZONTAL, command=g_sel)
g_scale.pack()
g_label = Label(rgbFrame)
g_label.pack()
b_var = IntVar()
b_scale = Scale(rgbFrame, variable = b_var, from_=0, to=255, showvalue=0, orient=HORIZONTAL, command=b_sel)
示例9: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def __init__(self, app, printer, settings, logger, *arg):
self.app = app
self.printer = printer
self.settings = settings
self.logger = logger
self.afterID = None
self.selection = None
if not self.app.printing:
self.logger.logMsg("Report only available while printing")
return
Toplevel.__init__(self, app, *arg)
self.title("Layer by Layer Timing")
self.protocol("WM_DELETE_WINDOW", self.doCancel)
fUL = Frame(self)
fUL.grid(row=1, column=1, rowspan=2, padx=10)
l = Label(fUL, text="Choose layer:")
l.pack()
lbf = Frame(fUL)
lbf.pack()
self.lbLayers = Listbox(lbf)
self.lbLayers.bind("<ButtonRelease-1>", self.clickLayers)
self.sb = Scrollbar(lbf, orient=VERTICAL)
self.sb.config(command=self.lbLayers.yview)
self.lbLayers.config(yscrollcommand=self.sb.set)
self.sb.pack(side=RIGHT, fill=Y)
self.lbLayers.pack(side=LEFT, fill=BOTH, expand=1)
rbf = LabelFrame(fUL, text="Time Format")
rbf.pack()
self.rbvTimeFmt = StringVar()
self.rbvTimeFmt.set(TIME_WALL)
rb = Radiobutton(rbf, text="Wall time", variable=self.rbvTimeFmt, value=TIME_WALL, command=self.doTimeFormat)
rb.pack(anchor=W)
rb = Radiobutton(rbf, text="From start", variable=self.rbvTimeFmt, value=TIME_START, command=self.doTimeFormat)
rb.pack(anchor=W)
rb = Radiobutton(rbf, text="From now", variable=self.rbvTimeFmt, value=TIME_NOW, command=self.doTimeFormat)
rb.pack(anchor=W)
fUR = Frame(self)
fUR.grid(row=1, column=2, rowspan=2, padx=10)
row = 1
lf = LabelFrame(fUR, text="Print Times: ")
lf.grid(row=row, column=1)
l = Label(lf, text="Start: ", width=12, justify=RIGHT)
l.grid(row=1, column=1, padx=10, sticky=E)
self.timePStart = Label(lf, text="", anchor=W, justify=LEFT)
self.timePStart.grid(row=1, column=3, padx=10)
l = Label(lf, text="Elapsed: ", width=12, justify=RIGHT)
l.grid(row=2, column=1, padx=10, sticky=E)
self.timeElapsed = Label(lf, text="", anchor=W, justify=LEFT)
self.timeElapsed.grid(row=2, column=3, padx=10)
l = Label(lf, text="Current: ", width=12, justify=RIGHT)
l.grid(row=3, column=1, padx=10, sticky=E)
self.timeNow = Label(lf, text="", anchor=W, justify=LEFT)
self.timeNow.grid(row=3, column=3, padx=10)
row += 1
lf = LabelFrame(fUR, text="Layer Start Time: ")
lf.grid(row=row, column=1)
l = Label(lf, text="original: ", width=12, justify=RIGHT)
l.grid(row=1, column=1, padx=10, sticky=E)
self.timeOStart = Label(lf, text="", anchor=W, justify=LEFT)
self.timeOStart.grid(row=1, column=2, padx=10)
l = Label(lf, text="revised: ", width=12, justify=RIGHT)
l.grid(row=2, column=1, padx=10, sticky=E)
self.timeRStart = Label(lf, text="", anchor=W, justify=LEFT)
self.timeRStart.grid(row=2, column=2, padx=10)
row += 1
lf = LabelFrame(fUR, text="Time in Layer: ")
lf.grid(row=row, column=1)
l = Label(lf, text="original: ", width=12, justify=RIGHT)
l.grid(row=1, column=2, padx=10, sticky=E)
self.timeOLayer = Label(lf, text="", anchor=W, justify=LEFT)
#.........这里部分代码省略.........
示例10: resetRaport
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def resetRaport():
textField.delete(0.0, END)
# rysowanie okna
mainWindow = Tk()
mainWindow.title("Delivery status")
mainWindow.resizable(width=False, height=False)
mainWindow.lift()
inputFrame = Frame(mainWindow, padx=10, pady=10)
inputFrame.pack(fill="both")
resultFrame = LabelFrame(mainWindow, text=" Raport ", font=("Verdana", 15, "bold"), padx=10, pady=10)
resultFrame.pack(pady=5)
label0 = Label(inputFrame, text="Wprowadz wartosci:", font=("Vileda", 15, "bold"))
label0.grid(row=1, column=0, sticky="W")
label1 = Label(inputFrame, text="Ilosc wszystkich TC w spotchecku: ").grid(row=3, column=0, sticky="W")
totalTCinput = Entry(inputFrame)
totalTCinput.grid(row=3, column=1)
label2 = Label(inputFrame, text="Ilosc TC w spotchecku ze statusem Failed:").grid(row=4, column=0, sticky="W")
failedTCinput = Entry(inputFrame)
failedTCinput.grid(row=4, column=1)
label3 = Label(inputFrame, text="Ilosc wszystkich PR/CR w deliverce:").grid(row=5, column=0, sticky="W")
totalPRCRinput = Entry(inputFrame)
totalPRCRinput.grid(row=5, column=1)
示例11: sdListComplete
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def sdListComplete(self, sdlist):
top = self.top = Toplevel(self.app)
top.title("SD Card Control")
top.protocol('WM_DELETE_WINDOW', self.delTop)
f = Frame(top, height=150, width=150)
f.grid(row=1, column=1);
self.tree = Treeview(f, height=12, selectmode='browse')
self.tree.column("#0", minwidth=100)
self.tree.bind("<<TreeviewSelect>>", self.treeSelect)
self.sb = Scrollbar(f)
self.sb.config(command=self.tree.yview)
self.tree.config(yscrollcommand=self.sb.set)
self.sb.pack(side=RIGHT, fill=Y)
self.tree.pack(side=LEFT, fill=BOTH, expand=1)
SDroot = SDDir('')
for item in sdlist:
if item.startswith('/'):
cd = SDroot
l = item[1:].split('/')
for d in l[:-1]:
ncd = cd.getDir(d)
if ncd == None:
ncd = cd.addDir(d)
cd = ncd
cd.addFile(l[-1], fqn=item)
else:
SDroot.addFile(item)
SDroot.sortAll()
self.fileMap = {}
self.startFile = None
self.loadDir(SDroot, '')
bf = Frame(top, width=50)
bf.grid(column=3, row=1)
blf = LabelFrame(bf, text="Print from SD Card", width=48, height=40)
self.bPrint = Button(blf, text='Print', command=self.doPrint, width = 6)
self.bPrint.pack()
blf.pack(fill='x')
blf = LabelFrame(bf, text="Delete from SD Card", width=48, height=40)
self.bDelete = Button(blf, text="Delete", command=self.doDelete, width=6)
self.bDelete.pack()
blf.pack(fill='x')
blf = LabelFrame(bf, text="Upload to SD Card", width=48, height=180)
self.upDir = Label(blf, text="Dir:", justify=LEFT)
self.upDir.pack()
ef = Frame(blf)
l = Label(ef, text="File:", justify=LEFT)
l.pack(side=LEFT)
self.entry = Entry(ef, width=12)
self.entry.pack(side=LEFT)
fn = 'untitled.g'
if self.app.GCodeFile:
fn = os.path.basename(self.app.GCodeFile)
if len(fn) > 8:
fn = fn[0:8]
fn += ".g"
self.entry.delete(0, END)
self.entry.insert(0, fn)
ef.pack()
self.bUpload = Button(blf, text="Upload", command=self.doUpload, width=6)
self.bUpload.pack()
blf.pack(fill='x')
if self.app.printing or self.app.sdprinting:
self.bPrint.config(state=DISABLED)
self.bUpload.config(state=DISABLED)
if not self.app.GCodeFile:
self.bUpload.config(state=DISABLED)
blf = Frame(bf)
self.bExit = Button(blf, text='Exit', command=self.doExit, width=6)
self.bExit.pack()
blf.pack()
if self.startFile:
self.tree.selection_set(self.startFile)
self.top.geometry("360x300+100+100")
示例12: initUI
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def initUI(self):
self.parent.title("IAF CALC 0.01")
self.pack(fill=BOTH, expand=1)
self.configure(background="white")
frameTOP = Frame(self)
frameTOP.config(bg="white")
frameTOP.pack(side=TOP)
frameFILES = Frame(frameTOP)
frameFILES.pack(side=LEFT, padx=10)
# --- BUTTON FOR FILE 1 --- #
frameF1 = LabelFrame(frameFILES, text="Eyes open file:", relief=FLAT, borderwidth=1, background="white")
frameF1.pack(fill=X, expand=1)
self.nameF1 = Entry(frameF1, width=50)
self.nameF1.config(bg="lightgray")
self.nameF1.pack(side=LEFT)
self.nameF1.delete(0, END)
self.nameF1.insert(0, "")
self.buttonLoadFile1 = Button(frameF1, text="...", command=self.askOpenFile1)
self.buttonLoadFile1.pack(side=LEFT, padx=5, pady=5)
# ----------------------- #
# --- BUTTON FOR FILE 2 --- #
frameF2 = LabelFrame(frameFILES, text="Eyes closed file:", relief=FLAT, borderwidth=1, background="white")
frameF2.pack(fill=X, expand=1)
self.nameF2 = Entry(frameF2, width=50)
self.nameF2.config(bg="lightgray")
self.nameF2.pack(side=LEFT)
self.nameF2.delete(0, END)
self.nameF2.insert(0, "")
self.buttonLoadFile2 = Button(frameF2, text="...", command=self.askOpenFile2)
self.buttonLoadFile2.pack(side=LEFT, padx=5, pady=5)
# ----------------------- #
# --- BUTTON FOR FILE OUTPUT --- #
frameO = LabelFrame(frameFILES, text="Output directory:", relief=FLAT, borderwidth=1, background="white")
frameO.pack(fill=X, expand=1)
self.nameO = Entry(frameO, width=50)
self.nameO.config(bg="lightgray")
self.nameO.pack(side=LEFT)
self.nameO.delete(0, END)
self.nameO.insert(0, "")
self.buttonSelectOutput = Button(frameO, text="...", command=self.askOutputDirectory)
self.buttonSelectOutput.pack(side=LEFT, padx=5, pady=5)
# -------------------------------#
# self.pack()
# self.pack(fill=Y, expand=1)
# ---------- PSD PARAMETER SELECTION ---------- #
framePARAM = Frame(frameTOP)
framePARAM.config(bg="white")
framePARAM.pack(side=LEFT, fill=X)
frame = LabelFrame(framePARAM, text="PSD Parameters", relief=RIDGE, borderwidth=1, background="white")
frame.pack(fill=BOTH, expand=1, side=TOP)
wFs = Label(frame, text="Fs:", bg="white")
wFs.pack(side=LEFT)
self.inputFs = Entry(frame, width=5)
self.inputFs.pack(side=LEFT, padx=5)
self.inputFs.delete(0, END)
self.inputFs.insert(0, "500")
wWS = Label(frame, text="Window size:", bg="white")
wWS.pack(side=LEFT)
self.inputWinSize = Entry(frame, width=5)
self.inputWinSize.pack(side=LEFT, padx=5)
self.inputWinSize.delete(0, END)
self.inputWinSize.insert(0, "1024")
wOL = Label(frame, text="Overlap:", bg="white")
wOL.pack(side=LEFT)
self.inputOverlap = Entry(frame, width=5)
self.inputOverlap.pack(side=LEFT, padx=5)
self.inputOverlap.delete(0, END)
self.inputOverlap.insert(0, "512")
wWT = Label(frame, text="Window function:", bg="white")
wWT.pack(side=LEFT)
variable = StringVar(frame)
variable.set("Hamming") # default value
self.inputWinType = OptionMenu(frame, variable, "Hamming", "Bartlett", "Blackman", "Hanning", "None")
self.inputWinType.config(bg="white", width=10)
self.inputWinType.pack(side=LEFT)
buttonRun = Button(frame, text="GO!", command=self.goTime)
buttonRun.pack(side=RIGHT)
# Channel selector
frameCh = LabelFrame(framePARAM, text="Channels", relief=RIDGE, borderwidth=1, background="white")
frameCh.pack(fill=BOTH, expand=1, side=TOP)
self.EOch1 = IntVar()
self.inputEOch1 = Checkbutton(frameCh, text="1", variable=self.EOch1, bg="white")
self.inputEOch1.pack(side=LEFT)
#.........这里部分代码省略.........
示例13: Tk
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
logger.setLevel(logging.INFO)
formatter = logging.Formatter('%(name)-12s: %(asctime)s : %(levelname)-8s %(message)s')
logger.handlers[0].setFormatter(formatter)
root = Tk()
root.iconify()
root.wm_title("Correlator Monitor: %s Block" % options.block.capitalize())
plots = Frame(root)
plots.pack(side=LEFT, fill=BOTH, expand=1)
window = Frame(root)
window.pack(side=RIGHT, fill=BOTH, expand=1)
plotting = LabelFrame(window, text='Plotting')
plotting.pack(fill=BOTH, expand=1)
monitor = LabelFrame(window, text='Monitor')
monitor.pack(fill=BOTH, expand=1)
control = LabelFrame(window, text='Control')
control.pack(fill=BOTH, expand=1)
window.columnconfigure(0, weight=1)
window.columnconfigure(1, weight=1)
window.rowconfigure(0, weight=1)
window.rowconfigure(1, weight=1)
window.rowconfigure(2, weight=1)
server = sma.SubmillimeterArrayClient(server_host, server_port)
示例14: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def __init__(self, statement, entry):
"""
instantiate a transaction window
"""
self.rules = statement.rules
self.root = Tk()
self.root.title("Manual Annotation")
t = Frame(self.root, bd=2 * self.BORDER)
# top stack: input file name
f = Frame(t)
caption = "File: " + statement.filename + ", line: " + str(statement.file_line)
Label(f, text=caption).pack()
f.pack(pady=self.PADDING)
# middle stack: entry details
f = Frame(t)
f1 = LabelFrame(f, text="Date")
self.date = Label(f1, text=entry.date)
self.date.pack(padx=self.PADDING, pady=self.PADDING)
f1.pack(side=LEFT, padx=self.PADDING)
f1 = LabelFrame(f, text="Amount")
self.amount = Label(f1, text=entry.amount)
self.amount.pack(padx=self.PADDING, pady=self.PADDING)
f1.pack(side=LEFT, padx=self.PADDING)
f1 = LabelFrame(f, text="Account")
self.acct = Text(f1, height=1, width=self.ACCT_WID)
if entry.account is not None:
self.acct.insert(END, entry.account)
self.acct.pack(padx=self.PADDING, pady=self.PADDING)
f1.pack(side=LEFT, padx=self.PADDING)
f1 = LabelFrame(f, text="Description")
self.desc = Text(f1, height=1, width=self.DESC_WID)
self.desc.insert(END, entry.description)
self.desc.pack(padx=self.PADDING, pady=self.PADDING)
f1.pack(side=LEFT, padx=self.PADDING)
f.pack(pady=self.PADDING)
# bottom stack: action buttons
f = Frame(t)
b = Button(f, text="Accept", command=self.accept)
b.pack(side=LEFT, padx=self.PADDING)
# account selection menu
self.account = StringVar(f)
self.account.set(entry.account)
m = OptionMenu(f, self.account, *sorted(statement.acc_list), command=self.chooseAcct)
m.pack(side=LEFT, padx=self.PADDING)
# aggregate description selection menu
self.description = StringVar(f)
self.menu = OptionMenu(f, self.description, *sorted(statement.agg_list), command=self.chooseDesc)
self.menu.pack(side=LEFT, padx=self.PADDING)
b = Button(f, text="Delete", command=self.delete)
b.pack(side=LEFT, padx=self.PADDING)
f.pack(padx=self.PADDING, pady=self.PADDING)
# finalize
t.pack(side=TOP)
self.entry = entry # default: return what we got
示例15: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import pack [as 别名]
def __init__(self, master=None, main=None):
Frame.__init__(self, master)
self.parent = master
self.main = main
self.parent.geometry("336x424")
self.parent.title(os.getenv("NAME") + " - Board Config")
self.master.configure(padx=10, pady=10)
self.intvar = IntVar()
#Arch
self.arch_var = IntVar()
lf_arch = LabelFrame(self.parent, text="Architecture")
lf_arch.pack(fill=X, expand=True, side=TOP)
frame_arch = Frame(lf_arch)
frame_arch.pack(fill=X, expand=True, side=TOP)
frame_left1 = Frame(frame_arch)
frame_left1.pack(expand=True, fill=BOTH, side=LEFT)
frame_right1 = Frame(frame_arch)
frame_right1.pack(expand=True, fill=BOTH, side=RIGHT)
self.radioButton_arch_8 = Radiobutton(frame_left1, text="8-bit ", anchor="w", width=10, value=8, variable=self.arch_var, command=self.update_mode)
self.radioButton_arch_8.pack(fill=X, side=TOP)
self.radioButton_arch_32 = Radiobutton(frame_right1, text="32-bit", anchor="w", width=10, value=32, variable=self.arch_var, command=self.update_mode)
self.radioButton_arch_32.pack(fill=X, side=TOP)
#Mode
self.mode_var = StringVar()
lf_mode = LabelFrame(self.parent, text="Programming mode")
lf_mode.pack(fill=X, expand=True, side=TOP)
frame_mode = Frame(lf_mode)
frame_mode.pack(fill=X, expand=True, side=TOP)
frame_left2 = Frame(frame_mode)
frame_left2.pack(expand=True, fill=BOTH, side=LEFT)
frame_right2 = Frame(frame_mode)
frame_right2.pack(expand=True, fill=BOTH, side=RIGHT)
self.radioButton_mode_icsp = Radiobutton(frame_left2, text="ICSP", anchor="w", width=10, value="icsp", variable=self.mode_var, command=self.update_mode)
self.radioButton_mode_icsp.pack(side=TOP, fill=X)
self.radioButton_mode_bootloader = Radiobutton(frame_right2, text="Bootloader", anchor="w", width=10, value="bootloader", variable=self.mode_var, command=self.update_mode)
self.radioButton_mode_bootloader.pack(side=TOP, fill=X)
#Bootloader
self.boot_var = StringVar()
self.lf_boot = LabelFrame(self.parent, text="Bootloader")
self.lf_boot.pack(fill=X, expand=True, side=TOP)
frame_boot = Frame(self.lf_boot)
frame_boot.pack(fill=X, expand=True, side=TOP)
frame_left3 = Frame(frame_boot)
frame_left3.pack(expand=True, fill=BOTH, side=LEFT)
frame_right3 = Frame(frame_boot)
frame_right3.pack(expand=True, fill=BOTH, side=RIGHT)
self.radioButton_bootloader_v1_v2 = Radiobutton(frame_left3, text="v1.x or v2.x", anchor="w", width=10, value="v1_v2", variable=self.boot_var)
self.radioButton_bootloader_v1_v2.pack(fill=X, side=TOP, expand=True)
self.radioButton_bootloader_v4 = Radiobutton(frame_right3, text="v4.x", anchor="w", width=10, value="v4", variable=self.boot_var)
self.radioButton_bootloader_v4.pack(fill=X, side=TOP, expand=True)
#Devices 8bit
self.dev8_var = StringVar()
self.lf_dev8 = LabelFrame(self.parent, text="Devices")
self.lf_dev8.pack(fill=X, expand=True, side=TOP)
self.frame_8b = Frame(self.lf_dev8)
self.frame_8b.pack(fill=X, expand=True, side=TOP)
#Devices 32bit
self.dev32_var = StringVar()
self.lf_dev32 = LabelFrame(self.parent, text="Devices")
self.lf_dev32.pack(fill=X, expand=True, side=TOP)
self.frame_32b = Frame(self.lf_dev32)
self.frame_32b.pack(fill=X, expand=True, side=TOP)
frame_buttons = Frame(self.parent)
Button(frame_buttons, text="Accept", command=self.accept_config).pack(fill=X, expand=True, side=RIGHT)
Button(frame_buttons, text="Cancel", command=self.quit).pack(fill=X, expand=True, side=LEFT)
frame_buttons.pack(fill=X, expand=True, side=BOTTOM)
frame_advance = Frame(self.parent)
self.advanceoptions = Button(frame_advance, text="Advance options", command=self.advance)
self.advanceoptions.pack(fill=X, expand=True, side=BOTTOM)
frame_advance.pack(fill=X, expand=True, side=BOTTOM)
#.........这里部分代码省略.........