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


Python tkinter.EW属性代码示例

本文整理汇总了Python中tkinter.EW属性的典型用法代码示例。如果您正苦于以下问题:Python tkinter.EW属性的具体用法?Python tkinter.EW怎么用?Python tkinter.EW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在tkinter的用法示例。


在下文中一共展示了tkinter.EW属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def __init__(self, parent, isRunning):
        super().__init__(parent)
        self.parent = parent
        self.pack()
        self.state = DayState()
        self.isRunning = isRunning

        self.textClock = tkinter.Label(self, width=60, text="现在时间是00:00", anchor=tkinter.W)
        self.textScreen = ScrolledText(self, height=10, width=60, state="disable")
        self.buttonUse = tkinter.Button(self, text="使用金库")
        self.buttonAlarm = tkinter.Button(self, text="按下警铃")
        self.buttonPhone = tkinter.Button(self, text="正常通话")
        self.buttonExit = tkinter.Button(self, text="结束", command=self.quit)

        self.textClock.grid(row=0, columnspan=6, padx=2, pady=2, sticky=tkinter.EW)
        self.textScreen.grid(row=1, columnspan=6, padx=2, pady=2, sticky=tkinter.EW)
        self.buttonUse.grid(row=2, column=1, padx=2, pady=2, sticky=tkinter.EW)
        self.buttonAlarm.grid(row=2, column=2, padx=2, pady=2, sticky=tkinter.EW)
        self.buttonPhone.grid(row=2, column=3, padx=2, pady=2, sticky=tkinter.EW)
        self.buttonExit.grid(row=2, column=4, padx=2, pady=2, sticky=tkinter.EW)

        self.buttonUse.bind("<Button-1>", self.useEvent)
        self.buttonAlarm.bind("<Button-1>", self.useAlarm)
        self.buttonPhone.bind("<Button-1>", self.usePhone) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:26,代码来源:SafeFrame.py

示例2: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def __init__(self, parent):
        super().__init__(parent)
        self.parent = parent
        self.pack()

        self.checkValue = tkinter.StringVar()

        self.createColleagues()

        self.checkGuest.grid(row=0, column=0, padx=2, pady=2, sticky=tkinter.W)
        self.checkLogin.grid(row=0, column=1, padx=2, pady=2, sticky=tkinter.EW)
        self.usernameLabel.grid(row=1, column=0, padx=2, pady=2, sticky=tkinter.W)
        self.textUser.grid(row=1, column=1, padx=2, pady=2, sticky=tkinter.EW)
        self.passwordLabel.grid(row=2, column=0, padx=2, pady=2, sticky=tkinter.W)
        self.textPassword.grid(row=2, column=1, padx=2, pady=2, sticky=tkinter.EW)
        self.buttonOk.grid(row=3, column=0, padx=2, pady=2, sticky=tkinter.EW)
        self.buttonCancel.grid(row=3, column=1, padx=2, pady=2, sticky=tkinter.EW)

        self.checkGuest.focus_set()

        self.checkGuest.bind("<Button-1>", self.colleagueChanged)
        self.checkLogin.bind("<Button-1>", self.colleagueChanged)

        self.textUser.bind("<Key>", self.colleagueChanged)
        self.textPassword.bind("<Key>", self.colleagueChanged) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:27,代码来源:LoginFrame.py

示例3: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
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) 
开发者ID:VCCRI,项目名称:SVPV,代码行数:23,代码来源:gui_widgets.py

示例4: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def __init__(self, parent):
        super().__init__(parent)
        self.parent = parent
        self.pack()
        self.history = MacroCommand()
        self.paintColor = "red"

        self.clearButton = tkinter.Button(self, text="clear")
        self.undoButton = tkinter.Button(self, text="undo")
        self.redButton = tkinter.Button(self, text="red")
        self.greenButton = tkinter.Button(self, text="green")
        self.blueButton = tkinter.Button(self, text="blue")
        self.canvas = tkinter.Canvas(self, width=400, height=300, bg="white")

        self.redButton.grid(row=0, column=1, padx=2, pady=2, sticky=tkinter.EW)
        self.greenButton.grid(row=0, column=2, padx=2, pady=2, sticky=tkinter.EW)
        self.blueButton.grid(row=0, column=3, padx=2, pady=2, sticky=tkinter.EW)
        self.clearButton.grid(row=0, column=4, padx=2, pady=2, sticky=tkinter.EW)
        self.undoButton.grid(row=0, column=5, padx=2, pady=2, sticky=tkinter.EW)
        self.canvas.grid(row=1, columnspan=7, padx=2, pady=2, sticky=tkinter.EW)

        self.canvas.bind("<B1-Motion>", self._mouseDragged)
        self.redButton.bind("<Button-1>", self._redPaint)
        self.greenButton.bind("<Button-1>", self._greenPaint)
        self.blueButton.bind("<Button-1>", self._bluePaint)
        self.clearButton.bind("<Button-1>", self._clearCanvas)
        self.undoButton.bind("<Button-1>", self._undoCanvas) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:29,代码来源:Main.py

示例5: set_samples

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def set_samples(self):
        for s in self.samples:
            self.GT_CBs.append(GenotypeSelector(self, s))
            self.GT_CBs[-1].grid(column=self.c, row=self.r, sticky = tk.EW)
            self.r += 1
            if self.r == self.max_row:
                self.r = 0
                self.c +=1 
开发者ID:VCCRI,项目名称:SVPV,代码行数:10,代码来源:gui_widgets.py

示例6: set_check_boxes

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def set_check_boxes(self):
        for gt in self.gts:
            self.checkVars.append(tk.IntVar(value=0))
            self.CBs.append(tk.Checkbutton(self, text=gt, variable=self.checkVars[-1], onvalue=1, offvalue=0))
            self.CBs[-1].grid(row = self.r, column=self.c, sticky=tk.EW)
            self.c += 1 
开发者ID:VCCRI,项目名称:SVPV,代码行数:8,代码来源:gui_widgets.py

示例7: reset

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def reset(self):
        self.len_GT_On.set(0)
        self.len_LT_On.set(0)
        self.len_GT_val.destroy()
        self.len_GT_Units.destroy()
        self.len_LT_val.destroy()
        self.len_LT_Units.destroy()
        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_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.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_val.grid(row=2, column=2, sticky=tk.EW)
        self.len_LT_Units.grid(row=2, column=3, sticky=tk.EW) 
开发者ID:VCCRI,项目名称:SVPV,代码行数:17,代码来源:gui_widgets.py

示例8: setup_static_features

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def setup_static_features(self):
        self.wm_title("SVPV - Structural Variant Prediction Viewer")
        self.window_size()

        if self.buttons_1:
            self.buttons_1.destroy()
        self.buttons_1 = tk.LabelFrame(self)
        if self.reset:
            self.reset.destroy()
        self.reset = tk.Button(self.buttons_1, text="Reset Filters", command=self.reset_filters)
        self.reset.grid(row=0, column=0, padx=40, sticky=tk.W)
        if self.list:
            self.list.destroy()
        self.list = tk.Button(self.buttons_1, text="Apply Filters", command=self.apply_filters)
        self.list.grid(row=0, column=1, padx=40, sticky=tk.E)
        self.buttons_1.grid(row=4, column=0, columnspan=2, sticky=tk.EW, padx=10)

        if self.buttons_2:
            self.buttons_2.destroy()
        self.buttons_2 = tk.LabelFrame(self)
        if self.viewGTs:
            self.viewGTs.destroy()
        self.viewGTs = tk.Button(self.buttons_2, text="Get Genotypes", command=self.view_gts)
        self.viewGTs.grid(row=0, column=0, padx=25, sticky=tk.W)
        if self.viewSV:
            self.viewSV.destroy()
        self.viewSV = tk.Button(self.buttons_2, text="Plot Selected SV", command=self.plot_sv)
        self.viewSV.grid(row=0, column=1, padx=25, sticky=tk.W)
        if self.plotAll:
            self.plotAll.destroy()
        self.plotAll = tk.Button(self.buttons_2, text="Plot All SVs", command=self.plot_all)
        self.plotAll.grid(row=0, column=2, padx=25, sticky=tk.E)
        if self.display_cb:
            self.display_cb.destroy()
        self.display_var = tk.IntVar(value=1)
        self.display_cb = tk.Checkbutton(self.buttons_2, text='display plot on creation', variable=self.display_var,
                                         onvalue=1, offvalue=0)
        self.display_cb.grid(row=1, column=1, padx=25, sticky=tk.E)
        self.buttons_2.grid(row=6, column=0, columnspan=2, sticky=tk.EW, padx=10) 
开发者ID:VCCRI,项目名称:SVPV,代码行数:41,代码来源:gui.py

示例9: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def __init__(self, master):
        super().__init__(master)
        # Get the username and save list of found files.
        self.__user = getpass.getuser()
        self.__dirlist = set()
        # Create widgets.
        self.__log = tkinter.Text(self)
        self.__bar = tkinter.ttk.Scrollbar(self, orient=tkinter.VERTICAL,
                                           command=self.__log.yview)
        self.__ent = tkinter.ttk.Entry(self, cursor='xterm')
        # Configure widgets.
        self.__log.configure(state=tkinter.DISABLED, wrap=tkinter.WORD,
                             yscrollcommand=self.__bar.set)
        # Create binding.
        self.__ent.bind('<Return>', self.create_message)
        # Position widgets.
        self.__log.grid(row=0, column=0, sticky=tkinter.NSEW)
        self.__bar.grid(row=0, column=1, sticky=tkinter.NS)
        self.__ent.grid(row=1, column=0, columnspan=2, sticky=tkinter.EW)
        # Configure resizing.
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)
        # Focus entry.
        self.__ent.focus_set()
        # Schedule message discovery.
        self.after_idle(self.get_messages) 
开发者ID:ActiveState,项目名称:code,代码行数:28,代码来源:recipe-577637.py

示例10: init_window

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def init_window(self):
        global root
        
        self.master.title("LPHK - Novation Launchpad Macro Scripting System")
        self.pack(fill="both", expand=1)

        self.m = tk.Menu(self.master)
        self.master.config(menu=self.m)

        self.m_Launchpad = tk.Menu(self.m, tearoff=False)
        self.m_Launchpad.add_command(label="Redetect (Restart)", command=self.redetect_lp)
        self.m.add_cascade(label="Launchpad", menu=self.m_Launchpad)

        self.m_Layout = tk.Menu(self.m, tearoff=False)
        self.m_Layout.add_command(label="New Layout", command=self.unbind_lp)
        self.m_Layout.add_command(label="Load Layout", command=self.load_layout)
        self.m_Layout.add_command(label="Save Layout", command=self.save_layout)
        self.m_Layout.add_command(label="Save Layout As...", command=self.save_layout_as)
        self.m.add_cascade(label="Layout", menu=self.m_Layout)

        self.disable_menu("Layout")
        
        self.m_Help = tk.Menu(self.m, tearoff=False)
        open_readme = lambda: webbrowser.open("https://github.com/nimaid/LPHK#lphk-launchpad-hotkey")
        self.m_Help.add_command(label="Open README...", command=open_readme)
        open_scripting = lambda: webbrowser.open("https://github.com/nimaid/LPHK#what-is-lphkscript-table-of-contents")
        self.m_Help.add_command(label="Scripting Help...", command=open_scripting)
        open_user_folder = lambda: files.open_file_folder(USER_PATH)
        self.m_Help.add_command(label="User Folder...", command=open_user_folder)
        open_prog_folder = lambda: files.open_file_folder(PROG_PATH)
        self.m_Help.add_command(label="Program Folder...", command=open_prog_folder)
        display_info = lambda: self.popup(self, "About LPHK", self.about_image, "A Novation Launchpad Macro Scripting System\nMade by Ella Jameson (nimaid)\n\nVersion: " + VERSION + "\nFile format version: " + files.FILE_VERSION, "Done")
        self.m_Help.add_command(label="About LPHK", command=display_info)
        self.m.add_cascade(label="Help", menu=self.m_Help)

        c_gap = int(BUTTON_SIZE // 4)

        c_size = (BUTTON_SIZE * 9) + (c_gap * 9)
        self.c = tk.Canvas(self, width=c_size, height=c_size)
        self.c.bind("<Button-1>", self.click)
        self.c.grid(row=0, column=0, padx=round(c_gap/2), pady=round(c_gap/2))

        self.stat = tk.Label(self, text="No Launchpad Connected", bg=STAT_INACTIVE_COLOR, fg="#fff")
        self.stat.grid(row=1, column=0, sticky=tk.EW)
        self.stat.config(font=("Courier", BUTTON_SIZE // 3, "bold")) 
开发者ID:nimaid,项目名称:LPHK,代码行数:47,代码来源:window.py

示例11: __init__

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def __init__(self, client, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.cl = client
        self.me = None

        self.title(TITLE)
        self.geometry(SIZE)

        # Signing in row; the entry supports phone and bot token
        self.sign_in_label = tkinter.Label(self, text='Loading...')
        self.sign_in_label.grid(row=0, column=0)
        self.sign_in_entry = tkinter.Entry(self)
        self.sign_in_entry.grid(row=0, column=1, sticky=tkinter.EW)
        self.sign_in_entry.bind('<Return>', self.sign_in)
        self.sign_in_button = tkinter.Button(self, text='...',
                                             command=self.sign_in)
        self.sign_in_button.grid(row=0, column=2)
        self.code = None

        # The chat where to send and show messages from
        tkinter.Label(self, text='Target chat:').grid(row=1, column=0)
        self.chat = tkinter.Entry(self)
        self.chat.grid(row=1, column=1, columnspan=2, sticky=tkinter.EW)
        self.columnconfigure(1, weight=1)
        self.chat.bind('<Return>', self.check_chat)
        self.chat.bind('<FocusOut>', self.check_chat)
        self.chat.focus()
        self.chat_id = None

        # Message log (incoming and outgoing); we configure it as readonly
        self.log = tkinter.scrolledtext.ScrolledText(self)
        allow_copy(self.log)
        self.log.grid(row=2, column=0, columnspan=3, sticky=tkinter.NSEW)
        self.rowconfigure(2, weight=1)
        self.cl.add_event_handler(self.on_message, events.NewMessage)

        # Save shown message IDs to support replying with ".rN reply"
        # For instance to reply to the last message ".r1 this is a reply"
        # Deletion also works with ".dN".
        self.message_ids = []

        # Save the sent texts to allow editing with ".s text/replacement"
        # For instance to edit the last "hello" with "bye" ".s hello/bye"
        self.sent_text = collections.deque(maxlen=10)

        # Sending messages
        tkinter.Label(self, text='Message:').grid(row=3, column=0)
        self.message = tkinter.Entry(self)
        self.message.grid(row=3, column=1, sticky=tkinter.EW)
        self.message.bind('<Return>', self.send_message)
        tkinter.Button(self, text='Send',
                       command=self.send_message).grid(row=3, column=2)

        # Post-init (async, connect client)
        self.cl.loop.create_task(self.post_init()) 
开发者ID:LonamiWebs,项目名称:Telethon,代码行数:57,代码来源:gui.py

示例12: _init_items

# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import EW [as 别名]
def _init_items(self):
        """
        .---------------.
        | Ctrl | Screen |
        |------|        |
        | Code |        |
        |      |        |
        """
        root = self._root
        root.resizable(0, 0)

        frm_control = tk.Frame(root, bg='#bbb')
        frm_control.grid(column=0, row=0, padx=5, sticky=tk.NW)
        frm_screen = tk.Frame(root, bg='#aaa')
        frm_screen.grid(column=1, row=0)

        frm_screenshot = tk.Frame(frm_control)
        frm_screenshot.grid(column=0, row=0, sticky=tk.W)
        tk.Label(frm_control, text='-'*30).grid(column=0, row=1, sticky=tk.EW)
        frm_code = tk.Frame(frm_control)
        frm_code.grid(column=0, row=2, sticky=tk.EW)

        self._btn_refresh = tk.Button(frm_screenshot, textvariable=self._refresh_text, command=self._refresh_screen)
        self._btn_refresh.grid(column=0, row=0, sticky=tk.W)
        # tk.Button(frm_screenshot, text="Wakeup", command=self._device.wakeup).grid(column=0, row=1, sticky=tk.W)
        tk.Button(frm_screenshot, text=u"保存选中区域", command=self._save_crop).grid(column=0, row=1, sticky=tk.W)
        
        # tk.Button(frm_screenshot, text="保存截屏", command=self._save_screenshot).grid(column=0, row=2, sticky=tk.W)
        frm_checkbtns = tk.Frame(frm_screenshot)
        frm_checkbtns.grid(column=0, row=3, sticky=(tk.W, tk.E))
        tk.Checkbutton(frm_checkbtns, text="Auto refresh", variable=self._auto_refresh_var, command=self._run_check_refresh).grid(column=0, row=0, sticky=tk.W)
        tk.Checkbutton(frm_checkbtns, text="UI detect", variable=self._uiauto_detect_var).grid(column=1, row=0, sticky=tk.W)

        frm_code_editor = tk.Frame(frm_code)
        frm_code_editor.grid(column=0, row=0, sticky=(tk.W, tk.E))
        tk.Label(frm_code_editor, text='Generated code').grid(column=0, row=0, sticky=tk.W)
        tk.Entry(frm_code_editor, textvariable=self._gencode_text, width=30).grid(column=0, row=1, sticky=tk.W)
        tk.Label(frm_code_editor, text='Save file name').grid(column=0, row=2, sticky=tk.W)
        tk.Entry(frm_code_editor, textvariable=self._genfile_name, width=30).grid(column=0, row=3, sticky=tk.W)
        tk.Label(frm_code_editor, text='Extention name').grid(column=0, row=4, sticky=tk.W)
        tk.Entry(frm_code_editor, textvariable=self._fileext_text, width=30).grid(column=0, row=5, sticky=tk.W)
        
        frm_code_btns = tk.Frame(frm_code)
        frm_code_btns.grid(column=0, row=2, sticky=(tk.W, tk.E))
        tk.Button(frm_code_btns, text='Run', command=self._run_code).grid(column=0, row=0, sticky=tk.W)
        self._btn_runedit = tk.Button(frm_code_btns, state=tk.DISABLED, text='Insert and Run', command=self._run_and_insert)
        self._btn_runedit.grid(column=1, row=0, sticky=tk.W)
        tk.Button(frm_code, text='Select File', command=self._run_selectfile).grid(column=0, row=4, sticky=tk.W)
        tk.Label(frm_code, textvariable=self._attachfile_text).grid(column=0, row=5, sticky=tk.W)
        tk.Button(frm_code, text='Reset', command=self._reset).grid(column=0, row=6, sticky=tk.W)

        self.canvas = tk.Canvas(frm_screen, bg="blue", bd=0, highlightthickness=0, relief='ridge')
        self.canvas.grid(column=0, row=0, padx=10, pady=10)
        self.canvas.bind("<Button-1>", self._stroke_start)
        self.canvas.bind("<B1-Motion>", self._stroke_move)
        self.canvas.bind("<B1-ButtonRelease>", self._stroke_done)
        self.canvas.bind("<Motion>", self._mouse_move) 
开发者ID:NetEaseGame,项目名称:ATX,代码行数:59,代码来源:tkgui.py


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