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


Python Tkinter.NORMAL属性代码示例

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


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

示例1: auth

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def auth(self, event=None):
        try:
            companion.session.auth_callback()
            self.status['text'] = _('Authentication successful')	# Successfully authenticated with the Frontier website
            if platform == 'darwin':
                self.view_menu.entryconfigure(0, state=tk.NORMAL)	# Status
                self.file_menu.entryconfigure(0, state=tk.NORMAL)	# Save Raw Data
            else:
                self.file_menu.entryconfigure(0, state=tk.NORMAL)	# Status
                self.file_menu.entryconfigure(1, state=tk.NORMAL)	# Save Raw Data
        except companion.ServerError as e:
            self.status['text'] = unicode(e)
        except Exception as e:
            if __debug__: print_exc()
            self.status['text'] = unicode(e)
        self.cooldown()

    # Handle Status event 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:20,代码来源:EDMarketConnector.py

示例2: load_pipeline

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def load_pipeline(self, event=None):
        top = tkinter.Toplevel()
        master_selector = SemTkMasterSelector(top, os.path.join(sem.SEM_DATA_DIR, "resources"))
        lang_selector = SemTkLangSelector(top, os.path.join(sem.SEM_DATA_DIR, "resources"))
        lang_selector.master_selector = master_selector
        vars_cur_row = 0
        vars_cur_row, _ = lang_selector.grid(row=vars_cur_row, column=0)
        vars_cur_row, _ = master_selector.grid(row=vars_cur_row, column=0)
        
        def cancel(event=None):
            if self.pipeline is not None:
                self.tag_document_btn.configure(state=tkinter.NORMAL)
            top.destroy()
        def ok(event=None):
            path = master_selector.workflow()
            pipeline, _, _, _ = sem.modules.tagger.load_master(path)
            self.pipeline = pipeline
            cancel()
        
        ok_btn = ttk.Button(top, text="load workflow", command=ok)
        ok_btn.grid(row=vars_cur_row, column=0)
        cancel_btn = ttk.Button(top, text="cancel", command=cancel)
        cancel_btn.grid(row=vars_cur_row, column=1) 
开发者ID:YoannDupont,项目名称:SEM,代码行数:25,代码来源:annotation_gui.py

示例3: load_listbox_click

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def load_listbox_click(self,*event):
        if self.load_listbox.size()==0:
            pass
        else:
            self.b_change_load.configure(state=tk.NORMAL, bg='yellow2')
            self.b_remove_load.configure(state=tk.NORMAL, bg='red3')

            self.selected_load = self.load_listbox.get(self.load_listbox.curselection()[0]).split(',')
            self.load_change_index = self.load_listbox.curselection()[0]

            self.load_span_select.set(self.selected_load[0])
            self.w1_gui.set(self.selected_load[1])
            self.w2_gui.set(self.selected_load[2])
            self.a_gui.set(self.selected_load[3])
            self.b_gui.set(self.selected_load[4])
            self.load_type.set(self.selected_load[5])
            self.load_kind_select.set(self.selected_load[6]) 
开发者ID:buddyd16,项目名称:Structural-Engineering,代码行数:19,代码来源:Frame_2D_GUI_metric.py

示例4: LoadAnalysisFromPath

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def LoadAnalysisFromPath(self, fileName):

            try:
                preferences = Preferences.get()
                preferences.analysisLastOpened = fileName
                preferences.save()
            except ExceptionHandler.ExceptionType as e:
                ExceptionHandler.add(e, "Cannot save preferences")

            self.analysisFilePathTextBox.config(state=tk.NORMAL)
            self.analysisFilePathTextBox.delete(0, tk.END)
            self.analysisFilePathTextBox.insert(0, fileName)
            self.analysisFilePathTextBox.config(state=tk.DISABLED)

            self.analysis = None
            self.analysisConfiguration = None

            if len(fileName) > 0:

                try:
                    self.analysisConfiguration = AnalysisConfiguration(fileName)
                    Status.add("Analysis config loaded: %s" % fileName)
                except ExceptionHandler.ExceptionType as e:

                    ExceptionHandler.add(e, "ERROR loading config") 
开发者ID:PCWG,项目名称:PCWG,代码行数:27,代码来源:root.py

示例5: login

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def login(self):
        if not self.status['text']:
            self.status['text'] = _('Logging in...')
        self.button['state'] = self.theme_button['state'] = tk.DISABLED
        if platform == 'darwin':
            self.view_menu.entryconfigure(0, state=tk.DISABLED)	# Status
            self.file_menu.entryconfigure(0, state=tk.DISABLED)	# Save Raw Data
        else:
            self.file_menu.entryconfigure(0, state=tk.DISABLED)	# Status
            self.file_menu.entryconfigure(1, state=tk.DISABLED)	# Save Raw Data
        self.w.update_idletasks()
        try:
            if companion.session.login(monitor.cmdr, monitor.is_beta):
                self.status['text'] = _('Authentication successful')	# Successfully authenticated with the Frontier website
                if platform == 'darwin':
                    self.view_menu.entryconfigure(0, state=tk.NORMAL)	# Status
                    self.file_menu.entryconfigure(0, state=tk.NORMAL)	# Save Raw Data
                else:
                    self.file_menu.entryconfigure(0, state=tk.NORMAL)	# Status
                    self.file_menu.entryconfigure(1, state=tk.NORMAL)	# Save Raw Data
        except (companion.CredentialsError, companion.ServerError, companion.ServerLagging) as e:
            self.status['text'] = unicode(e)
        except Exception as e:
            if __debug__: print_exc()
            self.status['text'] = unicode(e)
        self.cooldown() 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:28,代码来源:EDMarketConnector.py

示例6: cooldown

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def cooldown(self):
        if time() < self.holdofftime:
            self.button['text'] = self.theme_button['text'] = _('cooldown {SS}s').format(SS = int(self.holdofftime - time()))	# Update button in main window
            self.w.after(1000, self.cooldown)
        else:
            self.button['text'] = self.theme_button['text'] = _('Update')	# Update button in main window
            self.button['state'] = self.theme_button['state'] = (monitor.cmdr and
                                                                 monitor.mode and
                                                                 not monitor.state['Captain'] and
                                                                 monitor.system and
                                                                 tk.NORMAL or tk.DISABLED) 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:13,代码来源:EDMarketConnector.py

示例7: outvarchanged

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def outvarchanged(self, event=None):
        self.displaypath(self.outdir, self.outdir_entry)
        self.displaypath(self.logdir, self.logdir_entry)

        logdir = self.logdir.get()
        logvalid = logdir and exists(logdir)

        self.out_label['state'] = self.out_csv_button['state'] = self.out_td_button['state'] = self.out_ship_button['state'] = tk.NORMAL or tk.DISABLED
        local = self.out_td.get() or self.out_csv.get() or self.out_ship.get()
        self.out_auto_button['state']   = local and logvalid and tk.NORMAL or tk.DISABLED
        self.outdir_label['state']      = local and tk.NORMAL  or tk.DISABLED
        self.outbutton['state']         = local and tk.NORMAL  or tk.DISABLED
        self.outdir_entry['state']      = local and 'readonly' or tk.DISABLED 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:15,代码来源:prefs.py

示例8: displaypath

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def displaypath(self, pathvar, entryfield):
        entryfield['state'] = tk.NORMAL	# must be writable to update
        entryfield.delete(0, tk.END)
        if platform=='win32':
            start = pathvar.get().lower().startswith(config.home.lower()) and len(config.home.split('\\')) or 0
            display = []
            components = normpath(pathvar.get()).split('\\')
            buf = ctypes.create_unicode_buffer(MAX_PATH)
            pidsRes = ctypes.c_int()
            for i in range(start, len(components)):
                try:
                    if (not SHGetLocalizedName('\\'.join(components[:i+1]), buf, MAX_PATH, ctypes.byref(pidsRes)) and
                        LoadString(ctypes.WinDLL(expandvars(buf.value))._handle, pidsRes.value, buf, MAX_PATH)):
                        display.append(buf.value)
                    else:
                        display.append(components[i])
                except:
                    display.append(components[i])
            entryfield.insert(0, '\\'.join(display))
        elif platform=='darwin' and NSFileManager.defaultManager().componentsToDisplayForPath_(pathvar.get()):	# None if path doesn't exist
            if pathvar.get().startswith(config.home):
                display = ['~'] + NSFileManager.defaultManager().componentsToDisplayForPath_(pathvar.get())[len(NSFileManager.defaultManager().componentsToDisplayForPath_(config.home)):]
            else:
                display = NSFileManager.defaultManager().componentsToDisplayForPath_(pathvar.get())
            entryfield.insert(0, '/'.join(display))
        else:
            if pathvar.get().startswith(config.home):
                entryfield.insert(0, '~' + pathvar.get()[len(config.home):])
            else:
                entryfield.insert(0, pathvar.get())
        entryfield['state'] = 'readonly' 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:33,代码来源:prefs.py

示例9: hotkeylisten

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def hotkeylisten(self, event):
        good = hotkeymgr.fromevent(event)
        if good:
            (hotkey_code, hotkey_mods) = good
            event.widget.delete(0, tk.END)
            event.widget.insert(0, hotkeymgr.display(hotkey_code, hotkey_mods))
            if hotkey_code:
                # done
                (self.hotkey_code, self.hotkey_mods) = (hotkey_code, hotkey_mods)
                self.hotkey_only_btn['state'] = tk.NORMAL
                self.hotkey_play_btn['state'] = tk.NORMAL
                self.hotkey_only_btn.focus()	# move to next widget - calls hotkeyend() implicitly
        else:
            if good is None: 	# clear
                (self.hotkey_code, self.hotkey_mods) = (0, 0)
            event.widget.delete(0, tk.END)
            if self.hotkey_code:
                event.widget.insert(0, hotkeymgr.display(self.hotkey_code, self.hotkey_mods))
                self.hotkey_only_btn['state'] = tk.NORMAL
                self.hotkey_play_btn['state'] = tk.NORMAL
            else:
                event.widget.insert(0, _('None'))	# No hotkey/shortcut currently defined
                self.hotkey_only_btn['state'] = tk.DISABLED
                self.hotkey_play_btn['state'] = tk.DISABLED
            self.hotkey_only_btn.focus()	# move to next widget - calls hotkeyend() implicitly
        return('break')	# stops further processing - insertion, Tab traversal etc 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:28,代码来源:prefs.py

示例10: _leave

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def _leave(self, event, image):
        widget = event.widget
        if widget and widget['state'] != tk.DISABLED:
            widget.configure(state = tk.NORMAL)
            if image:
                image.configure(foreground = self.current['foreground'], background = self.current['background'])

    # Set up colors 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:10,代码来源:theme.py

示例11: __init__

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def __init__(self, master=None, **kw):
        self.url = 'url' in kw and kw.pop('url') or None
        self.popup_copy = kw.pop('popup_copy', False)
        self.underline = kw.pop('underline', None)	# override ttk.Label's underline
        self.foreground = kw.get('foreground') or 'blue'
        self.disabledforeground = kw.pop('disabledforeground', ttk.Style().lookup('TLabel', 'foreground', ('disabled',)))	# ttk.Label doesn't support disabledforeground option

        if platform == 'darwin':
            # Use tk.Label 'cos can't set ttk.Label background - http://www.tkdocs.com/tutorial/styles.html#whydifficult
            kw['background'] = kw.pop('background', 'systemDialogBackgroundActive')
            kw['anchor'] = kw.pop('anchor', tk.W)	# like ttk.Label
            tk.Label.__init__(self, master, **kw)
        else:
            ttk.Label.__init__(self, master, **kw)

        self.bind('<Button-1>', self._click)

        self.menu = tk.Menu(None, tearoff=tk.FALSE)
        self.menu.add_command(label=_('Copy'), command = self.copy)	# As in Copy and Paste
        self.bind(platform == 'darwin' and '<Button-2>' or '<Button-3>', self._contextmenu)

        self.bind('<Enter>', self._enter)
        self.bind('<Leave>', self._leave)

        # set up initial appearance
        self.configure(state = kw.get('state', tk.NORMAL),
                       text = kw.get('text'),
                       font = kw.get('font', ttk.Style().lookup('TLabel', 'font')))

    # Change cursor and appearance depending on state and text 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:32,代码来源:ttkHyperlinkLabel.py

示例12: prefs_cmdr_changed

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def prefs_cmdr_changed(cmdr, is_beta):
    this.log_button['state'] = cmdr and not is_beta and tk.NORMAL or tk.DISABLED
    this.apikey['state'] = tk.NORMAL
    this.apikey.delete(0, tk.END)
    if cmdr:
        cred = credentials(cmdr)
        if cred:
            this.apikey.insert(0, cred)
    this.label['state'] = this.apikey_label['state'] = this.apikey['state'] = cmdr and not is_beta and this.log.get() and tk.NORMAL or tk.DISABLED 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:11,代码来源:inara.py

示例13: prefs_cmdr_changed

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def prefs_cmdr_changed(cmdr, is_beta):
    this.log_button['state'] = cmdr and not is_beta and tk.NORMAL or tk.DISABLED
    this.user['state'] = tk.NORMAL
    this.user.delete(0, tk.END)
    this.apikey['state'] = tk.NORMAL
    this.apikey.delete(0, tk.END)
    if cmdr:
        this.cmdr_text['text'] = cmdr + (is_beta and ' [Beta]' or '')
        cred = credentials(cmdr)
        if cred:
            this.user.insert(0, cred[0])
            this.apikey.insert(0, cred[1])
    else:
        this.cmdr_text['text'] = _('None') 	# No hotkey/shortcut currently defined
    this.label['state'] = this.cmdr_label['state'] = this.cmdr_text['state'] = this.user_label['state'] = this.user['state'] = this.apikey_label['state'] = this.apikey['state'] = cmdr and not is_beta and this.log.get() and tk.NORMAL or tk.DISABLED 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:17,代码来源:edsm.py

示例14: check

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def check(self):
        """Method to chack that Lotus Notes COM interface is loaded"""
        if self.Lotus != None:
            self.checked = True
            self.log(ErrorLevel.NORMAL, _("Connection to Notes established\n"))
        else:
            self.unchecked()
            self.log(ErrorLevel.ERROR, _("Check the Notes password and that NSF2X and Notes use the same architecture\n"))
        return self.checked 
开发者ID:adb014,项目名称:nsf2x,代码行数:11,代码来源:nsf2x.py

示例15: configStop

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NORMAL [as 别名]
def configStop(self, AllowButton=True, ActionText=_("Stop")):
        """Gui Stop Button Configuration"""
        self.chooseNsfButton.config(state=tkinter.DISABLED)
        self.chooseDestButton.config(state=tkinter.DISABLED)
        self.entryPassword.config(state=tkinter.DISABLED)
        if AllowButton:
            self.startButton.config(text=ActionText, state=tkinter.NORMAL)
        else:
            self.startButton.config(text=ActionText, state=tkinter.DISABLED)
        self.optionsButton.config(state=tkinter.DISABLED)
        self.formatTypeEML.config(state=tkinter.DISABLED)
        self.formatTypeMBOX.config(state=tkinter.DISABLED)
        self.formatTypePST.config(state=tkinter.DISABLED) 
开发者ID:adb014,项目名称:nsf2x,代码行数:15,代码来源:nsf2x.py


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