本文整理汇总了Python中tkinter.BOTTOM属性的典型用法代码示例。如果您正苦于以下问题:Python tkinter.BOTTOM属性的具体用法?Python tkinter.BOTTOM怎么用?Python tkinter.BOTTOM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类tkinter
的用法示例。
在下文中一共展示了tkinter.BOTTOM属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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()
示例2: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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()
示例3: switch_response_log
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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)
# 生成代码的函数
示例4: _init_toolbar
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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)
示例5: _init_toolbar
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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)
示例6: opts_buttons
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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")
示例7: create_advance
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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)
示例8: view_init
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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)
示例9: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
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)
示例10: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
def __init__(self):
super().__init__()
self.title("Blackjack")
self.geometry("800x640")
self.resizable(False, False)
self.CARD_ORIGINAL_POSITION = 100
self.CARD_WIDTH_OFFSET = 100
self.PLAYER_CARD_HEIGHT = 300
self.DEALER_CARD_HEIGHT = 100
self.PLAYER_SCORE_TEXT_COORDS = (400, 450)
self.WINNER_TEXT_COORDS = (400, 250)
self.game_state = GameState()
self.game_screen = tk.Canvas(self, bg="white", width=800, height=500)
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.play_again_button = tk.Button(self.bottom_frame, text="Play Again", width=25, command=self.play_again)
self.quit_button = tk.Button(self.bottom_frame, text="Quit", width=25, command=self.destroy)
self.hit_button.pack(side=tk.LEFT, padx=(100, 200))
self.stick_button.pack(side=tk.LEFT)
self.bottom_frame.pack(side=tk.BOTTOM, fill=tk.X)
self.game_screen.pack(side=tk.LEFT, anchor=tk.N)
self.display_table()
示例11: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
def __init__(self, master, **kwargs):
super().__init__(**kwargs)
self.master = master
self.transient(self.master)
self.geometry('500x250')
self.title('Choose font and size')
self.configure(bg=self.master.background)
self.font_list = tk.Listbox(self, exportselection=False)
self.available_fonts = sorted(families())
for family in self.available_fonts:
self.font_list.insert(tk.END, family)
current_selection_index = self.available_fonts.index(self.master.font_family)
if current_selection_index:
self.font_list.select_set(current_selection_index)
self.font_list.see(current_selection_index)
self.size_input = tk.Spinbox(self, from_=0, to=99, value=self.master.font_size)
self.save_button = ttk.Button(self, text="Save", style="editor.TButton", command=self.save)
self.save_button.pack(side=tk.BOTTOM, fill=tk.X, expand=1, padx=40)
self.font_list.pack(side=tk.LEFT, fill=tk.Y, expand=1)
self.size_input.pack(side=tk.BOTTOM, fill=tk.X, expand=1)
示例12: create_statusbar
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
def create_statusbar(self):
statusBar = ttk.Frame(self.master)
statusLabel = ttk.Label(statusBar, textvariable=self.statusText)
statusLabel.grid(column=0, row=0, sticky=(tk.W, tk.E))
scoreLabel = ttk.Label(statusBar, textvariable=self.scoreText,
relief=tk.SUNKEN)
scoreLabel.grid(column=1, row=0)
statusBar.columnconfigure(0, weight=1)
statusBar.pack(side=tk.BOTTOM, fill=tk.X)
self.set_status_text("Click a tile or click File→New for a new "
"game")
示例13: create_statusbar
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
def create_statusbar(self):
statusBar = ttk.Frame(self.master)
statusLabel = ttk.Label(statusBar, textvariable=self.statusText)
statusLabel.grid(column=0, row=0, sticky=(tk.W, tk.E))
scoreLabel = ttk.Label(statusBar, textvariable=self.scoreText,
relief=tk.SUNKEN)
scoreLabel.grid(column=1, row=0)
TkUtil.Tooltip.Tooltip(scoreLabel,
text="Current score (High score)")
statusBar.columnconfigure(0, weight=1)
statusBar.pack(side=tk.BOTTOM, fill=tk.X)
self.set_status_text("Click a tile or click File→New for a new "
"game")
示例14: show_response_log
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
def show_response_log():
_select = nb.select()
setting = nb_names[_select]['setting']
if setting.get('type') == 'response':
setting.get('fr_temp2').pack(fill=tkinter.BOTH,expand=True,side=tkinter.BOTTOM)
# 获取内部文本的函数
示例15: show_code_log
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import BOTTOM [as 别名]
def show_code_log():
_select = nb.select()
setting = nb_names[_select]['setting']
if setting.get('type') == 'code' or setting.get('type') == 'js' or setting.get('type') == 'scrapy' or setting.get('type') == 'selenium':
setting.get('fr_temp2').pack(fill=tkinter.BOTH,expand=True,side=tkinter.BOTTOM)