Python Tkinter.LabelFrame() Examples
The following are 20
code examples of Tkinter.LabelFrame().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
Tkinter
, or try the search function
.
Example #1
Source File: gui.py From snn_toolbox with MIT License | 6 votes |
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]
Example #2
Source File: gui_widgets.py From SVPV with MIT License | 6 votes |
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)
Example #3
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent, svs, sv_count): tk.LabelFrame.__init__(self, parent, text="Structural Variant Call Selection") self.sv_fl = None if not svs: self.lab = tk.Label(self,text="-- No matches --") self.lab.grid(row=0, column=0, sticky = tk.EW) self.num_svs_lab = tk.Label(self, text='-- of %d SVs' % sv_count) else: self.sv_fl = FieldedListbox(self, ("SV Type", "Chr A", "Pos A", "Chr B", "Pos B", "Length (bp)", "AF")) for sv in svs: self.sv_fl.push_entry(sv.string_tuple()) self.num_svs_lab = tk.Label(self, text='%d of %d SVs' % (len(svs), sv_count)) self.sv_fl.grid(row=0, sticky = tk.NSEW) self.num_svs_lab.grid(row=1, column=0, sticky=tk.EW)
Example #4
Source File: test_widgets.py From PokemonGo-DesktopMap with MIT License | 5 votes |
def create(self, **kwargs): return tkinter.LabelFrame(self.root, **kwargs)
Example #5
Source File: Controls.py From Python-Media-Player with Apache License 2.0 | 5 votes |
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
Example #6
Source File: DisplayPanel.py From Python-Media-Player with Apache License 2.0 | 5 votes |
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
Example #7
Source File: strap_beam_gui.py From Structural-Engineering with BSD 3-Clause "New" or "Revised" License | 5 votes |
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)
Example #8
Source File: gui.py From snn_toolbox with MIT License | 5 votes |
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)
Example #9
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent, message): tk.LabelFrame.__init__(self, parent, text="Info") self.message = tk.Label(self, text=message, bg='white', width=55, justify=tk.LEFT) self.message.pack()
Example #10
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent): tk.LabelFrame.__init__(self, parent) self.af_on = tk.IntVar(value=0) self.af_on_cb = tk.Checkbutton(self, text="AF Threshold", variable=self.af_on) self.af_on_cb.grid(row=0, column=0, padx=3, columnspan=2, sticky=tk.EW) self.af_var = tk.DoubleVar() self.af_gt_lt = tk.IntVar(value=1) self.af_lt_radio_button = tk.Radiobutton(self, text="<", variable=self.af_gt_lt, value=1) self.af_lt_radio_button.grid(row=1, column=0, sticky=tk.EW) self.af_gt_radio_button = tk.Radiobutton(self, text=">", variable=self.af_gt_lt, value=2) self.af_gt_radio_button.grid(row=1, column=1, sticky=tk.EW) self.af_scale = tk.Scale(self, variable=self.af_var, from_=float(0), to=float(1), resolution=float(0.01), orient=tk.HORIZONTAL) self.af_scale.grid(row=2, column=0, padx=3, sticky=tk.EW, columnspan=2)
Example #11
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent): tk.LabelFrame.__init__(self, parent) self.ref_gene_on = tk.IntVar(value=0) self.ref_gene_on_cb = tk.Checkbutton(self, text="ref gene\nintersection", justify=tk.LEFT, variable=self.ref_gene_on) self.ref_gene_on_cb.grid(row=0, column=0, sticky=tk.W) self.gene_list_on = tk.IntVar(value=0) self.gene_list_on_cb = tk.Checkbutton(self, text="gene list\nintersection", justify=tk.LEFT, variable=self.gene_list_on) self.gene_list_on_cb.grid(row=1, column=0, sticky=tk.W) self.exonic_on = tk.IntVar(value=0) self.exonic_on_cb = tk.Checkbutton(self, text="exonic", justify=tk.LEFT, variable=self.exonic_on) self.exonic_on_cb.grid(row=2, column=0, sticky=tk.W)
Example #12
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent): tk.LabelFrame.__init__(self, parent, text="Filters") self.af_filter = AfFilter(self) self.gene_filter = GeneFilter(self) self.len_filter = LengthFilter(self) self.type_filter = SvTypeFilter(self) self.af_filter.grid(row=0, sticky=tk.NSEW, columnspan=2) self.gene_filter.grid(row=0, column=2, sticky=tk.NSEW) self.len_filter.grid(row=0, column=3, sticky=tk.NSEW) self.type_filter.grid(row=0, column=4, sticky=tk.NSEW)
Example #13
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent): tk.LabelFrame.__init__(self, parent, text="Plot Custom Range") self.parent = parent self.lab = tk.Label(self, text='Custom range:') self.rangeVar = tk.StringVar(value='chrX:YYYYYY-ZZZZZZ') self.entry = tk.Entry(self, textvariable=self.rangeVar, width=25) self.setter = tk.Button(self, text="Plot Custom", command=self.do_plot) self.lab.grid(row=0, column=0, sticky=tk.NSEW) self.entry.grid(row=0, column=1, sticky=tk.NSEW) self.setter.grid(row=0, column=2, sticky=tk.NSEW)
Example #14
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent, name): tk.LabelFrame.__init__(self, parent, text=name) self.gts = ["0/0", "0/1", "1/1"] self.checkVars = [] self.CBs = [] self.r = 0 self.c = 0 self.set_check_boxes()
Example #15
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent, samples): tk.LabelFrame.__init__(self, parent, text="Sample Genotype Selection") self.parent = parent self.samples = samples self.max_row = 5 if self.samples: self.GT_CBs = [] self.c = 0 self.r = 0 self.set_samples() else: self.GT_CBs = None self.lab = tk.Label(self,text="-- No samples Selected --") self.lab.grid(row=0, sticky = tk.EW)
Example #16
Source File: gui_widgets.py From SVPV with MIT License | 5 votes |
def __init__(self, parent, samples, ped=None): tk.LabelFrame.__init__(self, parent, text="Sample Selection") self.parent = parent self.samples = samples self.ped = ped self.families = [] if self.ped is None: self.flb = FieldedListbox(self, ('Sample',), width=20, selectmode=tk.EXTENDED) for s in self.samples: self.flb.push_entry((s,)) self.flb.grid(row=0, column=0, padx=10, columnspan=2) else: self.flb = FieldedListbox(self, ('Sample', 'Family'), width=15, selectmode=tk.EXTENDED) for s in self.samples: if s in ped.families_by_sample: self.families.append(ped.families_by_sample[s]) else: self.families.append('NA') self.flb.push_entry((s, self.families[-1])) self.flb.grid(row=0, column=0, padx=10, columnspan=3) self.select_b = tk.Button(self, text="Select", command=self.select) self.select_b.grid(row=1, column=0, padx=10) c = 1 if ped is not None: self.select_fam_b = tk.Button(self, text="Select Family", command=self.select_fam) self.select_fam_b.grid(row=1, column=c, padx=10) c += 1 self.clear = tk.Button(self, text="Clear", command=self.clear) self.clear.grid(row=1, column=c, padx=10)
Example #17
Source File: test_widgets.py From oss-ftp with MIT License | 5 votes |
def create(self, **kwargs): return tkinter.LabelFrame(self.root, **kwargs)
Example #18
Source File: fisheye.py From DualFisheye with MIT License | 4 votes |
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.
Example #19
Source File: GUI.py From Scoary with GNU General Public License v3.0 | 4 votes |
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 ########
Example #20
Source File: interactive_gui.py From DEMUD with Apache License 2.0 | 4 votes |
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