本文整理汇总了Python中Tkinter.LabelFrame方法的典型用法代码示例。如果您正苦于以下问题:Python Tkinter.LabelFrame方法的具体用法?Python Tkinter.LabelFrame怎么用?Python Tkinter.LabelFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter
的用法示例。
在下文中一共展示了Tkinter.LabelFrame方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def __init__(self, parent):
tk.LabelFrame.__init__(self, parent)
self.title = tk.Label(self, text='SV Length')
self.len_GT_On = tk.IntVar(value=0)
self.len_GT_On_CB = tk.Checkbutton(self, text=">", justify=tk.LEFT, variable=self.len_GT_On)
self.len_GT_val = tk.Spinbox(self, values=(1,5,10,50,100,500), width=3)
self.len_GT_Units = tk.Spinbox(self, values=("bp", "kbp", "Mbp"), width=3)
self.len_LT_On = tk.IntVar(value=0)
self.len_LT_On_CB = tk.Checkbutton(self, text="<", justify=tk.LEFT, variable=self.len_LT_On)
self.len_LT_val = tk.Spinbox(self, values=(1,5,10,50,100,500), width=3)
self.len_LT_Units = tk.Spinbox(self, values=("bp", "kbp", "Mbp"), width=3)
self.title.grid(row=0, column=0, sticky=tk.EW, columnspan=4)
self.len_GT_On_CB.grid(row=1, column=0, sticky=tk.EW)
self.len_GT_val.grid(row=2, column=0, sticky=tk.EW)
self.len_GT_Units.grid(row=2, column=1, sticky=tk.EW)
self.len_LT_On_CB.grid(row=1, column=2, sticky=tk.EW)
self.len_LT_val.grid(row=2, column=2, sticky=tk.EW)
self.len_LT_Units.grid(row=2, column=3, sticky=tk.EW)
示例2: select_layer_rb
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def select_layer_rb(self):
"""Select layer."""
if hasattr(self, 'layer_frame'):
self.layer_frame.pack_forget()
self.layer_frame.destroy()
self.layer_frame = tk.LabelFrame(self.graph_frame, labelanchor='nw',
text="Select layer", relief='raised',
borderwidth='3', bg='white')
self.layer_frame.pack(side='bottom', fill=None, expand=False)
self.plots_dir = os.path.join(self.gui_log.get(),
self.selected_plots_dir.get())
if os.path.isdir(self.plots_dir):
layer_dirs = [d for d in sorted(os.listdir(self.plots_dir))
if d != 'normalization' and
os.path.isdir(os.path.join(self.plots_dir, d))]
[tk.Radiobutton(self.layer_frame, bg='white', text=name,
value=name, command=self.display_graphs,
variable=self.layer_to_plot).pack(
fill='both', side='bottom', expand=True)
for name in layer_dirs]
示例3: create
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def create(self, **kwargs):
return tkinter.LabelFrame(self.root, **kwargs)
示例4: select_plots_dir_rb
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def select_plots_dir_rb(self):
"""Select plots directory."""
self.plot_dir_frame = tk.LabelFrame(self.graph_frame, labelanchor='nw',
text="Select dir", relief='raised',
borderwidth='3', bg='white')
self.plot_dir_frame.pack(side='top', fill=None, expand=False)
self.gui_log.set(os.path.join(self.settings['path_wd'].get(),
'log', 'gui'))
if os.path.isdir(self.gui_log.get()):
plot_dirs = [d for d in sorted(os.listdir(self.gui_log.get()))
if os.path.isdir(os.path.join(self.gui_log.get(), d))]
self.selected_plots_dir = tk.StringVar(value=plot_dirs[0])
[tk.Radiobutton(self.plot_dir_frame, bg='white', text=name,
value=name, command=self.select_layer_rb,
variable=self.selected_plots_dir).pack(
fill='both', side='bottom', expand=True)
for name in plot_dirs]
open_new_cb = tk.Checkbutton(self.graph_frame, bg='white', height=2,
width=20, text='open in new window',
variable=self.settings['open_new'])
open_new_cb.pack(**self.kwargs)
tip = dedent("""\
If unchecked, the window showing graphs for a certain layer will
close and be replaced each time you select a layer to plot.
If checked, an additional window will pop up instead.""")
ToolTip(open_new_cb, text=tip, wraplength=750)
示例5: static_analysis_frame_builder
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def static_analysis_frame_builder(self):
self.stat_service_frame = tk.LabelFrame(self.statics_data_frame, text="Service:", bd=1, relief='sunken', padx=5, pady=2)
self.stat_service_frame.grid(row=0, column=0, padx=5)
self.stat_ult_frame = tk.LabelFrame(self.statics_data_frame, text="Ultimate:", bd=1, relief='sunken', padx=5, pady=2)
self.stat_ult_frame.grid(row=0, column=1, padx=5)
wstat = 15
tk.Label(self.stat_service_frame, text="Source:", font=self.helv_res).grid(row=0, column=0, padx=5)
tk.Label(self.stat_service_frame, text="Load (kips):", font=self.helv_res).grid(row=0, column=1, padx=5)
tk.Label(self.stat_service_frame, text="Location (ft):", font=self.helv_res).grid(row=0, column=2, padx=5)
tk.Label(self.stat_service_frame, text="Moment Arm (ft):", font=self.helv_res).grid(row=0, column=3, padx=5)
tk.Label(self.stat_service_frame, text="Moment (ft-kips):", font=self.helv_res).grid(row=0, column=4, padx=5)
self.service_statics = []
self.service_statics.append(tk.Listbox(self.stat_service_frame, height = 10, width = wstat, font=self.helv))
self.service_statics.append(tk.Listbox(self.stat_service_frame, height = 10, width = wstat, font=self.helv))
self.service_statics.append(tk.Listbox(self.stat_service_frame, height = 10, width = wstat, font=self.helv))
self.service_statics.append(tk.Listbox(self.stat_service_frame, height = 10, width = wstat, font=self.helv))
self.service_statics.append(tk.Listbox(self.stat_service_frame, height = 10, width = wstat, font=self.helv))
self.service_statics[0].grid(row=1, column=0)
self.service_statics[1].grid(row=1, column=1)
self.service_statics[2].grid(row=1, column=2)
self.service_statics[3].grid(row=1, column=3)
self.service_statics[4].grid(row=1, column=4)
tk.Label(self.stat_ult_frame, text="Source:", font=self.helv_res).grid(row=0, column=0, padx=5)
tk.Label(self.stat_ult_frame, text="Load (kips):", font=self.helv_res).grid(row=0, column=1, padx=5)
tk.Label(self.stat_ult_frame, text="Location (ft):", font=self.helv_res).grid(row=0, column=2, padx=5)
tk.Label(self.stat_ult_frame, text="Moment Arm (ft):", font=self.helv_res).grid(row=0, column=3, padx=5)
tk.Label(self.stat_ult_frame, text="Moment (ft-kips):", font=self.helv_res).grid(row=0, column=4, padx=5)
self.ultimate_statics = []
self.ultimate_statics.append(tk.Listbox(self.stat_ult_frame, height = 10, width = wstat, font=self.helv))
self.ultimate_statics.append(tk.Listbox(self.stat_ult_frame, height = 10, width = wstat, font=self.helv))
self.ultimate_statics.append(tk.Listbox(self.stat_ult_frame, height = 10, width = wstat, font=self.helv))
self.ultimate_statics.append(tk.Listbox(self.stat_ult_frame, height = 10, width = wstat, font=self.helv))
self.ultimate_statics.append(tk.Listbox(self.stat_ult_frame, height = 10, width = wstat, font=self.helv))
self.ultimate_statics[0].grid(row=1, column=0)
self.ultimate_statics[1].grid(row=1, column=1)
self.ultimate_statics[2].grid(row=1, column=2)
self.ultimate_statics[3].grid(row=1, column=3)
self.ultimate_statics[4].grid(row=1, column=4)
示例6: create_console
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def create_console(self):
self.back_time_label=Tkinter.PhotoImage(file="../Icons/background.gif")
# consoleframe=Tkinter.LabelFrame(self.root, text='Display Panel', bg='aqua')
# consoleframe.pack(side='top', expand='yes', fill='x')
self.canvas=Tkinter.Canvas(self.root, width=400, height=100, bg='skyblue')
self.canvas.pack()
self.canvas.image=self.back_time_label
self.canvas.create_image(0, 0, anchor="nw", image=self.back_time_label)
self.time_display=self.canvas.create_text(10, 25, anchor="nw", fill='cornsilk', font=Digital_Clock_Font_Setting, text='0:00:00')
self.song_display=self.canvas.create_text(220,40, anchor="nw", fill='cornsilk', font=Songs_playing_Font_Setting, text='Nothing For Playing')
self.song_duration=self.canvas.create_text(220,65, anchor="nw", fill='cornsilk', font=duration_time_Font_Setting, text='[0:00:00]')
return
示例7: create_control_panel
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def create_control_panel(self):
frame=Tkinter.LabelFrame(self.root)
frame.pack(expand='yes',fill='x',side='top')
add_fileicon=Tkinter.PhotoImage(file="../Icons/add_file.gif")
add_directoryicon=Tkinter.PhotoImage(file="../Icons/add_directory.gif")
exiticon=Tkinter.PhotoImage(file="../Icons/exit.gif")
playicon=Tkinter.PhotoImage(file="../Icons/play.gif")
pauseicon=Tkinter.PhotoImage(file="../Icons/pause.gif")
stopicon=Tkinter.PhotoImage(file="../Icons/stop.gif")
rewindicon=Tkinter.PhotoImage(file="../Icons/rewind.gif")
fast_forwardicon=Tkinter.PhotoImage(file="../Icons/fast_forward.gif")
previous_trackicon=Tkinter.PhotoImage(file="../Icons/previous_track.gif")
next_trackicon=Tkinter.PhotoImage(file="../Icons/next_track.gif")
self.muteicon=Tkinter.PhotoImage(file="../Icons/mute.gif")
self.unmuteicon=Tkinter.PhotoImage(file="../Icons/unmute.gif")
delete_selectedicon=Tkinter.PhotoImage(file="../Icons/delete_selected.gif")
list_file=[
(playicon,'self.play'),
(pauseicon,'self.pause'),
(stopicon,'self.stop'),
(previous_trackicon,'self.previous'),
(rewindicon,'self.rewind'),
(fast_forwardicon,'self.fast'),
(next_trackicon,'self.Next'),]
for i,j in list_file:
storeobj=ttk.Button(frame, image=i,command=eval(j))
storeobj.pack(side='left')
storeobj.image=i
self.volume_label=Tkinter.Button(frame,image=self.unmuteicon)
self.volume_label.image=self.unmuteicon
volume=ttk.Scale(frame,from_=Volume_lowest_value, to=Volume_highest_value ,variable=self.var, command=self.update_volume)
volume.pack(side='right', padx=10, )
self.volume_label.pack(side='right')
return
示例8: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def __init__(self, parent):
# Store reference object for creating child dialogs.
self.parent = parent
self.win_lens1 = None
self.win_lens2 = None
self.win_align = None
self.work_done = False
self.work_error = None
self.work_status = None
# Create dummy lens configuration.
self.lens1 = FisheyeLens()
self.lens2 = FisheyeLens()
self.lens2.center_qq = [0,0,1,0] # Default flip along Y axis.
# Create frame for this GUI.
parent.wm_title('Panorama Creation Tool')
frame = tk.Frame(parent)
# Make file-selection inputs for the two images.
img_frame = tk.LabelFrame(frame, text='Input Images')
self.img1 = self._make_file_select(img_frame, 0, 'Image #1')
self.img2 = self._make_file_select(img_frame, 1, 'Image #2')
img_frame.pack()
# Make buttons to load, save, and adjust the lens configuration.
lens_frame = tk.LabelFrame(frame, text='Lens Configuration and Alignment')
btn_lens1 = tk.Button(lens_frame, text='Lens 1', command=self._adjust_lens1)
btn_lens2 = tk.Button(lens_frame, text='Lens 2', command=self._adjust_lens2)
btn_align = tk.Button(lens_frame, text='Align', command=self._adjust_align)
btn_auto = tk.Button(lens_frame, text='Auto', command=self._auto_align_start)
btn_load = tk.Button(lens_frame, text='Load', command=self.load_config)
btn_save = tk.Button(lens_frame, text='Save', command=self.save_config)
btn_lens1.grid(row=0, column=0, sticky='NESW')
btn_lens2.grid(row=0, column=1, sticky='NESW')
btn_align.grid(row=0, column=2, sticky='NESW')
btn_auto.grid(row=0, column=3, sticky='NESW')
btn_load.grid(row=1, column=0, columnspan=2, sticky='NESW')
btn_save.grid(row=1, column=2, columnspan=2, sticky='NESW')
lens_frame.pack(fill=tk.BOTH)
# Buttons to render the final output in different modes.
out_frame = tk.LabelFrame(frame, text='Final output rendering')
btn_rect = tk.Button(out_frame, text='Equirectangular',
command=self._render_rect)
btn_cube = tk.Button(out_frame, text='Cubemap',
command=self._render_cube)
btn_rect.pack(fill=tk.BOTH)
btn_cube.pack(fill=tk.BOTH)
out_frame.pack(fill=tk.BOTH)
# Status indicator box.
self.status = tk.Label(frame, relief=tk.SUNKEN,
text='Select input images to begin.')
self.status.pack(fill=tk.BOTH)
# Finish frame creation.
frame.pack()
# Helper function to destroy an object.
示例9: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def __init__(self,parent):
Tkinter.Tk.__init__(self,parent)
self.parent = parent
self.Scoary_parameters = {"GPA": None,"Trait":None,"Tree":None,
"Restrict":None, "Writetree": False,
"Delimiter":",", "Startcol": "15",
"Maxhits":None, "Notime":False,
"Outdir":None, "Permutations":0,
"No_pairwise":False, "Collapse":False,
"Cutoffs": {"I": [1,0.05],
"B": [0,1.0],
"BH": [0,1.0],
"PW": [0,1.0],
"EPW": [1,0.05],
"P":[0,1.0]},
}
self.initialize_menu()
self.toppart = Tkinter.Frame(self,height="350",width="800")
self.bottompart = Tkinter.Frame(self,height="50",width="800")
self.toppart.pack(side='top',expand=False)
self.bottompart.pack(side='bottom',expand=True,fill='both')
self.nwpart = Tkinter.Frame(self.toppart,
height="350",
width="250")
self.nepart = Tkinter.LabelFrame(self.toppart,
height="350",
width="550",
text="Control panel")
self.nwpart.pack(side='left',expand=False)
self.nepart.pack(side='right',expand=True)
# Add further frames to top or bottom
self.logocanvas = Tkinter.Canvas(self.nwpart,
height="250",
width="250",
relief="ridge",
bd=0,
highlightthickness=0)
self.logocanvas.pack(side='top',expand=False)
self.citationframe = Tkinter.Frame(self.nwpart,
height="100",
width="250")
self.citationframe.pack(side='bottom',expand=False,fill='none')
self.initialize_controlboard()
self.initialize_logo()
self.initialize_citation()
self.initialize_statusframe()
######## MENUS ########
示例10: createWidgets
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import LabelFrame [as 别名]
def createWidgets(self):
# Show a title
self.title = tk.Label(self,
text = 'Interactive DEMUD',
font = ('Helvetica', 24),
bg = '#ccf')
self.title.grid(ipadx = 100)
# Show selection information
self.selection = tk.Label(self,
textvariable = self.sel_var)
self.selection.grid()
# Show an image
self.image = Image.open('/Users/wkiri/Research/IMBUE/data/mastcam/multispectral_drcl/mastcam-034.jpg')
self.photo = ImageTk.PhotoImage(self.image)
self.imglbl = tk.Label(self, image = self.photo)
self.imglbl.grid()
# Show the user feedback options:
# 1. Interesting
# 2. Maybe
# 3. Uninteresting
self.fd = tk.LabelFrame(self,
text = 'Select one')
self.fd.grid(padx = 10)
self.thumbsup = ImageTk.PhotoImage(Image.open('/Users/wkiri/Research/IMBUE/git/src/demud/fig-thumbs-up.png'))
self.thumbsdown = ImageTk.PhotoImage(Image.open('/Users/wkiri/Research/IMBUE/git/src/demud/fig-thumbs-down.png'))
self.interButton = tk.Button(self.fd,
text = 'Interesting',
compound = tk.LEFT,
image = self.thumbsup,
command = self.chooseInteresting)
self.interButton.grid(row=0, column = 0)
self.maybeButton = tk.Button(self.fd,
text = 'Maybe',
command = self.chooseMaybe)
self.maybeButton.grid(row=0, column = 1)
self.unintButton = tk.Button(self.fd,
text = 'Uninteresting',
compound = tk.RIGHT,
image = self.thumbsdown,
command = self.chooseUninteresting)
self.unintButton.grid(row=0, column = 2)
# Create the quit button
self.quitButton = tk.Button(self,
text = 'Quit',
command = self.quit,
background = '#fcc')
self.quitButton.grid(ipadx = 30,
pady = 10)
# Main script