Python tkinter.BOTTOM Examples
The following are 30
code examples of tkinter.BOTTOM().
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: tab.py From vrequest with MIT License | 6 votes |
def switch_response_log(*a): _select = nb.select() setting = nb_names[_select]['setting'] if setting.get('type') in ['response','code','js','scrapy','selenium']: temp_fr2 = setting.get('fr_temp2') try: temp_fr2.pack_info() packed = True except: packed = False if packed: temp_fr2.pack_forget() else: temp_fr2.pack(fill=tkinter.BOTH,expand=True,side=tkinter.BOTTOM) # 生成代码的函数
Example #2
Source File: _backend_tk.py From GraphicDesignPatternByPython with MIT License | 6 votes |
def _init_toolbar(self): xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin Tk.Frame.__init__(self, master=self.window, width=int(width), height=int(height), borderwidth=2) self.update() # Make axes menu for text, tooltip_text, image_file, callback in self.toolitems: if text is None: # Add a spacer; return value is unused. self._Spacer() else: button = self._Button(text=text, file=image_file, command=getattr(self, callback)) if tooltip_text is not None: ToolTip.createToolTip(button, tooltip_text) self.message = Tk.StringVar(master=self) self._message_label = Tk.Label(master=self, textvariable=self.message) self._message_label.pack(side=Tk.RIGHT) self.pack(side=Tk.BOTTOM, fill=Tk.X)
Example #3
Source File: display_analysis.py From faceswap with GNU General Public License v3.0 | 6 votes |
def opts_buttons(self, frame): """ Add the option buttons """ logger.debug("Building Buttons") btnframe = ttk.Frame(frame) btnframe.pack(fill=tk.X, pady=5, padx=5, side=tk.BOTTOM) lblstatus = ttk.Label(btnframe, width=40, textvariable=self.vars["status"], anchor=tk.W) lblstatus.pack(side=tk.LEFT, anchor=tk.W, fill=tk.X, expand=True) for btntype in ("reload", "save"): cmd = getattr(self, "optbtn_{}".format(btntype)) btn = ttk.Button(btnframe, image=get_images().icons[btntype], command=cmd) btn.pack(padx=2, side=tk.RIGHT) hlp = self.set_help(btntype) Tooltip(btn, text=hlp, wraplength=200) logger.debug("Built Buttons")
Example #4
Source File: _backend_tk.py From python3_ios with BSD 3-Clause "New" or "Revised" License | 6 votes |
def _init_toolbar(self): xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin Tk.Frame.__init__(self, master=self.window, width=int(width), height=int(height), borderwidth=2) self.update() # Make axes menu for text, tooltip_text, image_file, callback in self.toolitems: if text is None: # Add a spacer; return value is unused. self._Spacer() else: button = self._Button(text=text, file=image_file, command=getattr(self, callback)) if tooltip_text is not None: ToolTip.createToolTip(button, tooltip_text) self.message = Tk.StringVar(master=self) self._message_label = Tk.Label(master=self, textvariable=self.message) self._message_label.pack(side=Tk.RIGHT) self.pack(side=Tk.BOTTOM, fill=Tk.X)
Example #5
Source File: tkui.py From onmyoji_bot with GNU General Public License v3.0 | 6 votes |
def create_advance(self): ''' 高级菜单 ''' advance = tk.LabelFrame(self.main_frame1, text='高级选项') advance.pack(padx=5, pady=5, fill=tk.X, side=tk.BOTTOM) tk.Checkbutton(advance, text='调试模式', variable=self.debug_enable).pack(anchor=tk.W) tk.Checkbutton(advance, text='超时自动关闭阴阳师', variable=self.watchdog_enable).pack(anchor=tk.W) frame = tk.Frame(advance) frame.pack(anchor=tk.W) tk.Label(frame, text=' 画面超时时间(秒):').grid(row=0, column=0) tk.Entry(frame, textvariable=self.max_win_time, width=5).grid(row=0, column=1) tk.Label(frame, text=' 操作超时时间(秒):').grid(row=1, column=0) tk.Entry(frame, textvariable=self.max_op_time, width=5).grid(row=1, column=1)
Example #6
Source File: _backend_tk.py From Mastering-Elasticsearch-7.0 with MIT License | 6 votes |
def _init_toolbar(self): xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin tk.Frame.__init__(self, master=self.window, width=int(width), height=int(height), borderwidth=2) self.update() # Make axes menu for text, tooltip_text, image_file, callback in self.toolitems: if text is None: # Add a spacer; return value is unused. self._Spacer() else: button = self._Button(text=text, file=image_file, command=getattr(self, callback)) if tooltip_text is not None: ToolTip.createToolTip(button, tooltip_text) self.message = tk.StringVar(master=self) self._message_label = tk.Label(master=self, textvariable=self.message) self._message_label.pack(side=tk.RIGHT) self.pack(side=tk.BOTTOM, fill=tk.X)
Example #7
Source File: voyagerimb.py From voyagerimb with MIT License | 6 votes |
def view_init(self): self.frame = tk.LabelFrame(self.browser.workframe, text=" Image ") self.frame.pack(side=tk.LEFT, fill=tk.BOTH, expand=True, padx=7, pady=7) self.figure = plt.figure(figsize=(8, 12), dpi=70) self.ax1 = plt.subplot2grid((50,40), (0, 0), rowspan=40, colspan=40) self.ax2 = plt.subplot2grid((50,40), (42, 0), rowspan=8, colspan=40, sharex=self.ax1) plt.subplots_adjust(left=0.1, bottom=0.05, right=0.95, top=0.97, wspace=0.2, hspace=0.2) self.view_plot_image() self.canvas = FigureCanvasTkAgg(self.figure, self.frame) if self.mpltlib3: self.canvas.draw() toolbar = NavigationToolbar2Tk(self.canvas, self.frame).update() else: self.canvas.show() toolbar = NavigationToolbar2TkAgg(self.canvas, self.frame).update() self.canvas.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True) self.canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, padx=2, pady=2, expand=True) self.frame.pack(side=tk.LEFT, fill=tk.BOTH, expand=True, padx=7, pady=7)
Example #8
Source File: chapter5_04.py From Tkinter-GUI-Application-Development-Cookbook with MIT License | 6 votes |
def __init__(self, conn): super().__init__() self.title("SQLite Contacts list") self.conn = conn self.selection = None self.list = ContactList(self, height=15) self.form = UpdateContactForm(self) self.btn_new = tk.Button(self, text="Add new contact", command=self.add_contact) self.contacts = self.load_contacts() for contact in self.contacts: self.list.insert(contact) self.list.pack(side=tk.LEFT, padx=10, pady=10) self.form.pack(padx=10, pady=10) self.btn_new.pack(side=tk.BOTTOM, pady=5) self.list.bind_doble_click(self.show_contact) self.form.bind_save(self.update_contact) self.form.bind_delete(self.delete_contact)
Example #9
Source File: graph.py From PyEveLiveDPS with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent, **kwargs): tk.Frame.__init__(self, parent, **kwargs) self.parent = parent self.degree = 5 self.graphFigure = Figure(figsize=(4,2), dpi=100, facecolor="black") self.subplot = self.graphFigure.add_subplot(1,1,1, facecolor=(0.3, 0.3, 0.3)) self.subplot.tick_params(axis="y", colors="grey", direction="in") self.subplot.tick_params(axis="x", colors="grey", labelbottom="off", bottom="off") self.graphFigure.axes[0].get_xaxis().set_ticklabels([]) self.graphFigure.subplots_adjust(left=(30/100), bottom=(15/100), right=1, top=(1-15/100), wspace=0, hspace=0) self.canvas = FigureCanvasTkAgg(self.graphFigure, self) self.canvas.get_tk_widget().configure(bg="black") self.canvas.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True) self.canvas.show()
Example #10
Source File: ch4.py From Tkinter-GUI-Programming-by-Example with MIT License | 6 votes |
def __init__(self): super().__init__() self.title("Blackjack") self.geometry("800x640") self.resizable(False, False) self.bottom_frame = tk.Frame(self, width=800, height=140, bg="red") self.bottom_frame.pack_propagate(0) self.hit_button = tk.Button(self.bottom_frame, text="Hit", width=25, command=self.hit) self.stick_button = tk.Button(self.bottom_frame, text="Stick", width=25, command=self.stick) self.next_round_button = tk.Button(self.bottom_frame, text="Next Round", width=25, command=self.next_round) self.quit_button = tk.Button(self.bottom_frame, text="Quit", width=25, command=self.destroy) self.new_game_button = tk.Button(self.bottom_frame, text="New Game", width=25, command=self.new_game) self.bottom_frame.pack(side=tk.BOTTOM, fill=tk.X) self.game_screen = GameScreen(self, bg="white", width=800, height=500) self.game_screen.pack(side=tk.LEFT, anchor=tk.N) self.game_screen.setup_opening_animation()
Example #11
Source File: _backend_tk.py From coffeegrindsize with MIT License | 6 votes |
def _init_toolbar(self): xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin Tk.Frame.__init__(self, master=self.window, width=int(width), height=int(height), borderwidth=2) self.update() # Make axes menu for text, tooltip_text, image_file, callback in self.toolitems: if text is None: # Add a spacer; return value is unused. self._Spacer() else: button = self._Button(text=text, file=image_file, command=getattr(self, callback)) if tooltip_text is not None: ToolTip.createToolTip(button, tooltip_text) self.message = Tk.StringVar(master=self) self._message_label = Tk.Label(master=self, textvariable=self.message) self._message_label.pack(side=Tk.RIGHT) self.pack(side=Tk.BOTTOM, fill=Tk.X)
Example #12
Source File: _backend_tk.py From CogAlg with MIT License | 6 votes |
def _init_toolbar(self): xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin tk.Frame.__init__(self, master=self.window, width=int(width), height=int(height), borderwidth=2) self.update() # Make axes menu for text, tooltip_text, image_file, callback in self.toolitems: if text is None: # Add a spacer; return value is unused. self._Spacer() else: button = self._Button(text=text, file=image_file, command=getattr(self, callback)) if tooltip_text is not None: ToolTip.createToolTip(button, tooltip_text) self.message = tk.StringVar(master=self) self._message_label = tk.Label(master=self, textvariable=self.message) self._message_label.pack(side=tk.RIGHT) self.pack(side=tk.BOTTOM, fill=tk.X)
Example #13
Source File: control_helper.py From faceswap with GNU General Public License v3.0 | 5 votes |
def build_panel(self, blank_nones, scrollbar): """ Build the options frame for this command """ logger.debug("Add Config Frame") if scrollbar: self.add_scrollbar() self._canvas.bind("<Configure>", self.resize_frame) for option in self.options: group_frame = self.get_group_frame(option.group) sub_group_frame = self._get_subgroup_frame(group_frame["frame"], option.subgroup) frame = group_frame["frame"] if sub_group_frame is None else sub_group_frame.subframe ctl = ControlBuilder(frame, option, label_width=self.label_width, checkbuttons_frame=group_frame["chkbtns"], option_columns=self.option_columns, blank_nones=blank_nones) if group_frame["chkbtns"].items > 0: group_frame["chkbtns"].parent.pack(side=tk.BOTTOM, fill=tk.X, anchor=tk.NW) self.controls.append(ctl) for control in self.controls: filebrowser = control.filebrowser if filebrowser is not None: filebrowser.set_context_action_option(self.options) logger.debug("Added Config Frame")
Example #14
Source File: display_page.py From faceswap with GNU General Public License v3.0 | 5 votes |
def add_options_frame(self): """ Add the display tab options """ logger.debug("Adding options frame") optsframe = ttk.Frame(self) optsframe.pack(side=tk.BOTTOM, padx=5, pady=5, fill=tk.X) return optsframe
Example #15
Source File: popup_configure.py From faceswap with GNU General Public License v3.0 | 5 votes |
def add_frame_separator(self): """ Add a separator between top and bottom frames """ logger.debug("Add frame seperator") sep = ttk.Frame(self.page_frame, height=2, relief=tk.RIDGE) sep.pack(fill=tk.X, pady=(5, 0), side=tk.BOTTOM) logger.debug("Added frame seperator")
Example #16
Source File: custom_widgets.py From faceswap with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, hide_status=False): super().__init__(parent) self.pack(side=tk.BOTTOM, padx=10, pady=2, fill=tk.X, expand=False) self._message = tk.StringVar() self._pbar_message = tk.StringVar() self._pbar_position = tk.IntVar() self._message.set("Ready") self._status(hide_status) self._pbar = self._progress_bar()
Example #17
Source File: display_analysis.py From faceswap with GNU General Public License v3.0 | 5 votes |
def opts_build(self, frame): """ Build Options into the options frame """ logger.debug("Building Options") self.opts_combobox(frame) self.opts_checkbuttons(frame) self.opts_loss_keys(frame) self.opts_slider(frame) self.opts_buttons(frame) sep = ttk.Frame(frame, height=2, relief=tk.RIDGE) sep.pack(fill=tk.X, pady=(5, 0), side=tk.BOTTOM) logger.debug("Built Options")
Example #18
Source File: popup_configure.py From faceswap with GNU General Public License v3.0 | 5 votes |
def add_actions(self): """ Add Action buttons """ logger.debug("Add action buttons") frame = ttk.Frame(self.page_frame) frame.pack(fill=tk.BOTH, padx=5, pady=5, side=tk.BOTTOM) btn_cls = ttk.Button(frame, text="Cancel", width=10, command=self.destroy) btn_cls.pack(padx=2, side=tk.RIGHT) Tooltip(btn_cls, text="Close without saving", wraplength=720) btn_ok = ttk.Button(frame, text="OK", width=10, command=self.save_config) btn_ok.pack(padx=2, side=tk.RIGHT) Tooltip(btn_ok, text="Close and save config", wraplength=720) btn_rst = ttk.Button(frame, text="Reset", width=10, command=self.reset) btn_rst.pack(padx=2, side=tk.RIGHT) Tooltip(btn_rst, text="Reset all plugins to default values", wraplength=720) logger.debug("Added action buttons")
Example #19
Source File: command.py From faceswap with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent): logger.debug("Initializing %s: (command: '%s')", self.__class__.__name__, parent.command) super().__init__(parent) self.pack(fill=tk.BOTH, padx=5, pady=5, side=tk.BOTTOM, anchor=tk.N) self.command = parent.command self.title = self.command.title() self.add_action_button(parent.category, parent.actionbtns) logger.debug("Initialized %s", self.__class__.__name__)
Example #20
Source File: run_gui.py From margipose with Apache License 2.0 | 5 votes |
def __init__(self, dataset, device, model): super().__init__() self.dataset = dataset self.device = device self.model = model self.wm_title('3D pose estimation') self.geometry('1280x800') matplotlib.rcParams['savefig.format'] = 'svg' matplotlib.rcParams['savefig.directory'] = os.curdir # Variables self.var_cur_example = tk.StringVar() self.var_pred_visible = tk.IntVar(value=0) self.var_gt_visible = tk.IntVar(value=1) self.var_mpjpe = tk.StringVar(value='??') self.var_pck = tk.StringVar(value='??') self.var_aligned = tk.IntVar(value=0) self.var_joint = tk.StringVar(value='pelvis') if self.model is not None: self.var_pred_visible.set(1) global_toolbar = self._make_global_toolbar(self) global_toolbar.pack(side=tk.TOP, fill=tk.X) self.notebook = ttk.Notebook(self) self.notebook.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True, padx=4, pady=4) def on_change_tab(event): self.update_current_tab() self.notebook.bind('<<NotebookTabChanged>>', on_change_tab) self.tab_update_funcs = [ self._make_overview_tab(self.notebook), self._make_heatmap_tab(self.notebook), ] self.current_example_index = 0
Example #21
Source File: display_graph.py From faceswap with GNU General Public License v3.0 | 5 votes |
def _init_toolbar(self): """ Same as original but ttk widgets and standard tool-tips used. Separator added and message label packed to the left """ xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin ttk.Frame.__init__(self, master=self.window, width=int(width), height=int(height)) sep = ttk.Frame(self, height=2, relief=tk.RIDGE) sep.pack(fill=tk.X, pady=(5, 0), side=tk.TOP) self.update() # Make axes menu btnframe = ttk.Frame(self) btnframe.pack(fill=tk.X, padx=5, pady=5, side=tk.RIGHT) for text, tooltip_text, image_file, callback in self.toolitems: if text is None: # Add a spacer; return value is unused. self._Spacer() else: button = self._Button(btnframe, text=text, file=image_file, command=getattr(self, callback)) if tooltip_text is not None: Tooltip(button, text=tooltip_text, wraplength=200) self.message = tk.StringVar(master=self) self._message_label = ttk.Label(master=self, textvariable=self.message) self._message_label.pack(side=tk.LEFT, padx=5) self.pack(side=tk.BOTTOM, fill=tk.X)
Example #22
Source File: preview.py From faceswap with GNU General Public License v3.0 | 5 votes |
def _build_frame(self, defaults, refresh_callback, patch_callback, available_masks, has_predicted_mask): """ Build the :class:`ActionFrame`. Parameters ---------- defaults: dict The default command line options patch_callback: python function The function to execute when a patch callback is received refresh_callback: python function The function to execute when a refresh callback is received available_masks: list The available masks that exist within the alignments file has_predicted_mask: bool Whether the model was trained with a mask Returns ------- ttk.Progressbar A Progress bar to indicate that the Preview tool is busy """ logger.debug("Building Action frame") bottom_frame = ttk.Frame(self) bottom_frame.pack(side=tk.BOTTOM, fill=tk.X, anchor=tk.S) top_frame = ttk.Frame(self) top_frame.pack(side=tk.TOP, fill=tk.BOTH, anchor=tk.N, expand=True) self._add_cli_choices(top_frame, defaults, available_masks, has_predicted_mask) busy_indicator = self._add_busy_indicator(bottom_frame) self._add_refresh_button(bottom_frame, refresh_callback) self._add_patch_callback(patch_callback) self._add_actions(bottom_frame) logger.debug("Built Action frame") return busy_indicator
Example #23
Source File: preview.py From faceswap with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, config_key, options): logger.debug("Initializing %s", self.__class__.__name__) super().__init__(parent) self.pack(side=tk.TOP, fill=tk.BOTH, expand=True) self._options = options self._action_frame = ttk.Frame(self) self._action_frame.pack(padx=0, pady=(0, 5), side=tk.BOTTOM, fill=tk.X, anchor=tk.E) self._add_frame_separator() self._build_frame(parent, config_key) logger.debug("Initialized %s", self.__class__.__name__)
Example #24
Source File: preview.py From faceswap with GNU General Public License v3.0 | 5 votes |
def _add_actions(self, parent, config_key): """ Add Action Buttons. Parameters ---------- parent: tkinter object The tkinter object that will hold this configuration frame config_key: str The section/plugin key for these configuration options """ logger.debug("Adding util buttons") title = config_key.split(".")[1].replace("_", " ").title() btn_frame = ttk.Frame(self._action_frame) btn_frame.pack(padx=5, side=tk.BOTTOM, fill=tk.X) for utl in ("save", "clear", "reload"): logger.debug("Adding button: '%s'", utl) img = get_images().icons[utl] if utl == "save": text = "Save {} config".format(title) action = parent.config_tools.save_config elif utl == "clear": text = "Reset {} config to default values".format(title) action = parent.config_tools.reset_config_to_default elif utl == "reload": text = "Reset {} config to saved values".format(title) action = parent.config_tools.reset_config_to_saved btnutl = ttk.Button(btn_frame, image=img, command=lambda cmd=action: cmd(config_key)) btnutl.pack(padx=2, side=tk.RIGHT) Tooltip(btnutl, text=text, wraplength=200) logger.debug("Added util buttons")
Example #25
Source File: tkui.py From onmyoji_bot with GNU General Public License v3.0 | 5 votes |
def create_command(self): ''' 按钮 ''' button_area = tk.Frame(self.main_frame2) button_area.pack(fill=tk.X, side=tk.BOTTOM, padx=5, pady=5) tk.Button(button_area, text='开始', command=self.start_onmyoji).pack(fill=tk.X) tk.Button(button_area, text='退出', command=self.stop_onmyoji).pack(fill=tk.X)
Example #26
Source File: voyagerimb.py From voyagerimb with MIT License | 5 votes |
def view_init(self): self.frame = tk.LabelFrame(self.controlwidgets.frame, text=" Offset ") ftop = tk.Frame(self.frame) fbottom = tk.Frame(self.frame) self.offset_entry = NumericalIntEntry(ftop) self.offset_entry.textvariable.set("0") self.offset_entry.textvariable.trace("w", self.model_sync_with_entry) self.offset_entry.Entry.pack(side=tk.LEFT, fill=tk.X, expand=True) tk.Button(ftop, text="sub", width=1, command=self.model_decrement_offset).pack(side=tk.LEFT) tk.Button(ftop, text="add", width=1, command=self.model_increment_offset).pack(side=tk.LEFT) _mm = tk.Frame(fbottom) for radiobutrow in [["1000", "100", "10", "1"], ["NoS x SLW", "100 x SLW", "10 x SLW", "1 x SLW"]]: _mmm = tk.Frame(_mm) for interval_value in radiobutrow: _m = tk.Radiobutton(_mmm, text="%s" % (interval_value), indicatoron=0, foreground="#940015", variable=self.interval_value_variable, value=interval_value, width=1 ) _m.pack(side=tk.TOP, fill=tk.X, expand=True) _mmm.pack(side=tk.LEFT, fill=tk.X, expand=True) None _mm.pack(side=tk.BOTTOM, fill=tk.X, expand=True) ftop.pack(side=tk.TOP, fill=tk.BOTH, padx=4, pady=4, expand=True) fbottom.pack(side=tk.TOP, fill=tk.BOTH, padx=4, pady=4, expand=True) self.frame.pack(side=tk.TOP, fill=tk.X, padx=7, pady=7, expand=False)
Example #27
Source File: stopwatch_gui_external.py From sismic with GNU Lesser General Public License v3.0 | 5 votes |
def create_widgets(self): self.pack() # Add buttons self.w_btn_start = tk.Button(self, text='start', command=self._start) self.w_btn_stop = tk.Button(self, text='stop', command=self._stop) self.w_btn_split = tk.Button(self, text='split', command=self._split) self.w_btn_unsplit = tk.Button(self, text='unsplit', command=self._unsplit) self.w_btn_reset = tk.Button(self, text='reset', command=self._reset) self.w_btn_quit = tk.Button(self, text='quit', command=self._quit) # Initial button states self.w_btn_stop['state'] = tk.DISABLED self.w_btn_unsplit['state'] = tk.DISABLED # Pack self.w_btn_start.pack(side=tk.LEFT,) self.w_btn_stop.pack(side=tk.LEFT,) self.w_btn_split.pack(side=tk.LEFT,) self.w_btn_unsplit.pack(side=tk.LEFT,) self.w_btn_reset.pack(side=tk.LEFT,) self.w_btn_quit.pack(side=tk.LEFT,) # Active states label self.w_states = tk.Label(root) self.w_states.pack(side=tk.BOTTOM, fill=tk.X) # Timer label self.w_timer = tk.Label(root, font=("Helvetica", 16), pady=5) self.w_timer.pack(side=tk.BOTTOM, fill=tk.X)
Example #28
Source File: stopwatch_gui.py From sismic with GNU Lesser General Public License v3.0 | 5 votes |
def create_widgets(self): self.pack() # Add buttons self.w_btn_start = tk.Button(self, text='start', command=self._start) self.w_btn_stop = tk.Button(self, text='stop', command=self._stop) self.w_btn_split = tk.Button(self, text='split', command=self._split) self.w_btn_unsplit = tk.Button(self, text='unsplit', command=self._unsplit) self.w_btn_reset = tk.Button(self, text='reset', command=self._reset) self.w_btn_quit = tk.Button(self, text='quit', command=self._quit) # Initial button states self.w_btn_stop['state'] = tk.DISABLED self.w_btn_unsplit['state'] = tk.DISABLED # Pack self.w_btn_start.pack(side=tk.LEFT,) self.w_btn_stop.pack(side=tk.LEFT,) self.w_btn_split.pack(side=tk.LEFT,) self.w_btn_unsplit.pack(side=tk.LEFT,) self.w_btn_reset.pack(side=tk.LEFT,) self.w_btn_quit.pack(side=tk.LEFT,) # Active states label self.w_states = tk.Label(root) self.w_states.pack(side=tk.BOTTOM, fill=tk.X) # Timer label self.w_timer = tk.Label(root, font=("Helvetica", 16), pady=5) self.w_timer.pack(side=tk.BOTTOM, fill=tk.X)
Example #29
Source File: contacts_view.py From Tkinter-GUI-Application-Development-Cookbook with MIT License | 5 votes |
def __init__(self): super().__init__() self.title("SQLite Contacts list") self.list = ContactList(self, height=15) self.form = UpdateContactForm(self) self.btn_new = tk.Button(self, text="Add new contact") self.list.pack(side=tk.LEFT, padx=10, pady=10) self.form.pack(padx=10, pady=10) self.btn_new.pack(side=tk.BOTTOM, pady=5)
Example #30
Source File: review_filtered_clips.py From youtube-gesture-dataset with BSD 3-Clause "New" or "Revised" License | 5 votes |
def make_img_canvas(self): self.img_canvas = tk.Canvas(self.img_frame, bg='black') self.img_canvas.config(scrollregion=(0, 0, review_img_width, review_img_height)) hbar = tk.Scrollbar(self.img_frame, orient=tk.HORIZONTAL) hbar.pack(side=tk.BOTTOM, fill=tk.X) hbar.config(command=self.img_canvas.xview) vbar = tk.Scrollbar(self.img_frame, orient=tk.VERTICAL) vbar.pack(side=tk.RIGHT, fill=tk.Y) vbar.config(command=self.img_canvas.yview) self.img_canvas.bind("<MouseWheel>", self._on_mousewheel) self.img_canvas.config(xscrollcommand=hbar.set, yscrollcommand=vbar.set) self.img_canvas.pack(expand=tk.YES, fill=tk.BOTH)