本文整理汇总了Python中tkinter.SW属性的典型用法代码示例。如果您正苦于以下问题:Python tkinter.SW属性的具体用法?Python tkinter.SW怎么用?Python tkinter.SW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类tkinter
的用法示例。
在下文中一共展示了tkinter.SW属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import SW [as 别名]
def __init__(self):
super().__init__()
self.title("Ttk Notebook")
todos = {
"Home": ["Do the laundry", "Go grocery shopping"],
"Work": ["Install Python", "Learn Tkinter", "Reply emails"],
"Vacations": ["Relax!"]
}
self.notebook = ttk.Notebook(self, width=250, height=100, padding=10)
for key, value in todos.items():
frame = ttk.Frame(self.notebook)
self.notebook.add(frame, text=key, underline=0,
sticky=tk.NE + tk.SW)
for text in value:
ttk.Label(frame, text=text).pack(anchor=tk.W)
self.label = ttk.Label(self)
self.notebook.pack()
self.label.pack(anchor=tk.W)
self.notebook.enable_traversal()
self.notebook.bind("<<NotebookTabChanged>>", self.select_tab)
示例2: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import SW [as 别名]
def __init__(self):
self.shown = False
self.callback = None
self.callback_params = None
self.zyngui = zynthian_gui_config.zyngui
# Main Frame
self.main_frame = tkinter.Frame(zynthian_gui_config.top,
width = zynthian_gui_config.display_width,
height = zynthian_gui_config.display_height,
bg = zynthian_gui_config.color_bg)
self.text = tkinter.StringVar()
self.label_text = tkinter.Label(self.main_frame,
font=(zynthian_gui_config.font_family,zynthian_gui_config.font_size,"normal"),
textvariable=self.text,
wraplength=zynthian_gui_config.display_width-zynthian_gui_config.font_size*2,
justify=tkinter.LEFT,
padx=zynthian_gui_config.font_size,
pady=zynthian_gui_config.font_size,
bg=zynthian_gui_config.color_bg,
fg=zynthian_gui_config.color_tx)
self.label_text.place(x=0, y=0, anchor=tkinter.NW)
self.yes_text_label=tkinter.Label(self.main_frame,
font=(zynthian_gui_config.font_family,zynthian_gui_config.font_size*2,"normal"),
text="Yes",
width=3,
justify=tkinter.RIGHT,
padx=zynthian_gui_config.font_size,
pady=zynthian_gui_config.font_size,
bg=zynthian_gui_config.color_ctrl_bg_off,
fg=zynthian_gui_config.color_tx)
self.yes_text_label.bind("<Button-1>",self.cb_yes_push)
self.yes_text_label.place(x=zynthian_gui_config.display_width, y=zynthian_gui_config.display_height, anchor=tkinter.SE)
self.no_text_label=tkinter.Label(self.main_frame,
font=(zynthian_gui_config.font_family,zynthian_gui_config.font_size*2,"normal"),
text="No",
width=3,
justify=tkinter.LEFT,
padx=zynthian_gui_config.font_size,
pady=zynthian_gui_config.font_size,
bg=zynthian_gui_config.color_ctrl_bg_off,
fg=zynthian_gui_config.color_tx)
self.no_text_label.bind("<Button-1>",self.cb_no_push)
self.no_text_label.place(x=0, y=zynthian_gui_config.display_height, anchor=tkinter.SW)