当前位置: 首页>>代码示例>>Python>>正文


Python tkinter.SW属性代码示例

本文整理汇总了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) 
开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Application-Development-Cookbook,代码行数:25,代码来源:chapter8_05.py

示例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) 
开发者ID:zynthian,项目名称:zynthian-ui,代码行数:49,代码来源:zynthian_gui_confirm.py


注:本文中的tkinter.SW属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。