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


Python Tkinter.DISABLED属性代码示例

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


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

示例1: remove_last_beam_func

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def remove_last_beam_func(self,*event):
        if self.beam_count <= 1:
            pass
        else:
            self.b_solve_frame.configure(state=tk.DISABLED, bg='red3')
            self.beam_count -=1
            self.frame_built = 0
            self.frame_solved = 0
            self.beam_labels.remove(self.beam_inputs[-1][0].get())

            self.refesh_span_options()

            del self.beam_inputs[-1]
            del self.column_up_inputs[-1]
            del self.column_down_inputs[-1]
            #del self.nodetorsion_inputs[-1]

            self.build_bm_gui_table()
            self.build_colup_gui_table()
            self.build_coldwn_gui_table() 
开发者ID:buddyd16,项目名称:Structural-Engineering,代码行数:22,代码来源:Frame_2D_GUI_metric.py

示例2: build_coldwn_gui_table

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def build_coldwn_gui_table(self,*event):
        for element in self.column_down_gui_list:
            element.destroy()

        del self.column_down_gui_list[:]

        for i,col in enumerate(self.column_down_inputs):

            b = tk.Entry(self.coldwn_info_tab,textvariable=col[0], width=12, state=tk.DISABLED)
            b.grid(row=i+2,column=1)
            c = tk.Entry(self.coldwn_info_tab,textvariable=col[1], width=8)
            c.grid(row=i+2,column=2)
            d = tk.Entry(self.coldwn_info_tab,textvariable=col[2], width=8)
            d.grid(row=i+2,column=3)
            e = tk.Entry(self.coldwn_info_tab,textvariable=col[3], width=8)
            e.grid(row=i+2,column=4)
            f = tk.Entry(self.coldwn_info_tab,textvariable=col[4], width=8)
            f.grid(row=i+2,column=5)
            g = tk.Checkbutton(self.coldwn_info_tab,variable=col[5])
            g.grid(row=i+2,column=6)
            h = tk.Checkbutton(self.coldwn_info_tab,variable=col[6])
            h.grid(row=i+2,column=7)

            self.column_down_gui_list.extend([b,c,d,e,f,g,h]) 
开发者ID:buddyd16,项目名称:Structural-Engineering,代码行数:26,代码来源:Frame_2D_GUI_metric.py

示例3: fill_load_listbox

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def fill_load_listbox(self,*event):
        self.b_solve_frame.configure(state=tk.DISABLED, bg='red3')
        self.frame_solved = 0

        self.load_listbox.delete(0,tk.END)

        color = "pale green"
        i=0
        for x in self.gui_load_list:
            self.load_listbox.insert(tk.END,'{0},{1:.3f},{2:.3f},{3:.3f},{4:.3f},{5},{6}'.format(x[0],x[1],x[2],x[3],x[4],x[5],x[6]))

            if i % 2 == 0:
                self.load_listbox.itemconfigure(i, background=color)
            else:
                pass
            i+=1 
开发者ID:buddyd16,项目名称:Structural-Engineering,代码行数:18,代码来源:Frame_2D_GUI_metric.py

示例4: build_bm_gui_table

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def build_bm_gui_table(self,*event):

            for element in self.beam_gui_list:
                element.destroy()

            del self.beam_gui_list[:]

            for i,bm in enumerate(self.beam_inputs):

                a = tk.Entry(self.bm_info_tab,textvariable=bm[0], width=8, state=tk.DISABLED)
                a.grid(row=i+2,column=1, pady=4)
                b = tk.Entry(self.bm_info_tab,textvariable=bm[1], width=8)
                b.grid(row=i+2,column=2)
                c = tk.Entry(self.bm_info_tab,textvariable=bm[2], width=8)
                c.grid(row=i+2,column=3)
                d = tk.Entry(self.bm_info_tab,textvariable=bm[3], width=8)
                d.grid(row=i+2,column=4)

                self.beam_gui_list.extend([a,b,c,d]) 
开发者ID:buddyd16,项目名称:Structural-Engineering,代码行数:21,代码来源:Frame_2D_GUI.py

示例5: initial_simulator

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def initial_simulator(self):
        root = Tk()
        root.title("GPIO Simulator")
        previous = Button(root, text="Previous", command=self.previous)
        main = Button(root, text="Main button", command=self.main)
        next = Button(root, text="Next", command=self.next)
        vol_up = Button(root, text="Vol +", command=self.vol_up)
        vol_up_long = Button(root, text="Vol + long", command=self.vol_up_long)
        vol_down = Button(root, text="Vol -", command=self.vol_down)
        vol_down_long = Button(root, text="Vol - long",
                               command=self.vol_down_long)
        main_long = Button(root, text="Main long", command=self.main_long)
        self.playing_led = Checkbutton(text="playing_led", state=DISABLED)

        vol_up.grid(row=0, column=1)
        vol_up_long.grid(row=0, column=2)
        previous.grid(row=1, column=0)
        main.grid(row=1, column=1)
        main_long.grid(row=1, column=2)
        next.grid(row=1, column=3)
        vol_down.grid(row=2, column=1)
        vol_down_long.grid(row=2, column=2)
        self.playing_led.grid(row=3, column=1)

        root.mainloop() 
开发者ID:9and3r,项目名称:mopidy-ttsgpio,代码行数:27,代码来源:gpio_simulator.py

示例6: addDatePickerEntry

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def addDatePickerEntry(self, master, title, validation, value, width = None):

        if value != None:
            if type(value) == str:
                textValue = value
            else:
                textValue = value.strftime(datePickerFormat)
        else:
            textValue = None
      
        entry = self.addEntry(master, title + " " + datePickerFormatDisplay, validation, textValue, width = width)
        entry.entry.config(state=tk.DISABLED)
        
        pickButton = tk.Button(master, text=".", command = DatePicker(self, entry, datePickerFormat), width=3, height=1)
        pickButton.grid(row=(self.row-1), sticky=tk.N, column=self.inputColumn, padx = 160)

        clearButton = tk.Button(master, text="x", command = ClearEntry(entry), width=3, height=1)
        clearButton.grid(row=(self.row-1), sticky=tk.W, column=self.inputColumn, padx = 133)
                
        entry.bindPickButton(pickButton)

        return entry 
开发者ID:PCWG,项目名称:PCWG,代码行数:24,代码来源:pcwg_tool_reborn.py

示例7: addDatePickerEntry

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def addDatePickerEntry(self, master, title, validation, value, width = None):

        if value != None:
            if type(value) == str:
                textValue = value
            else:
                textValue = value.strftime(datePickerFormat)
        else:
            textValue = None
                
        entry = self.addEntry(master, title + " " + datePickerFormatDisplay, validation, textValue, width = width)
        entry.entry.config(state=tk.DISABLED)
        
        pickButton = tk.Button(master, text="...", command = DatePicker(self, entry, datePickerFormat), width=3, height=1)
        pickButton.grid(row=(self.row-1), sticky=tk.N, column=self.inputColumn, padx = 160)
                
        entry.bindPickButton(pickButton)

        return entry 
开发者ID:PCWG,项目名称:PCWG,代码行数:21,代码来源:base_dialog.py

示例8: LoadAnalysisFromPath

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [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

示例9: onTokenRightClick

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def onTokenRightClick(self, event):
        item = self._get_id(event)

        popup = tk.Menu(self, tearoff=0)
        popup.add_command(label='Grow', command=lambda: self.grow_node(item),
                              accelerator='G')
        popup.add_command(label='Grow until...',
                          command=lambda: self.grow_until(item))
        popup.add_command(label='Mark', command=lambda: self.mark_node(item),
                              accelerator='M')
        popup.add_command(label='Hide', command=lambda: self.hide_node(item),
                              accelerator='H')

        hide_behind = tk.Menu(popup, tearoff=0)
        for _, n in self.dispG.edges_iter(item):
            assert _ == item
            if self._radial_behind(item, n):
                state = tk.ACTIVE
            else:
                state = tk.DISABLED
            hide_behind.add_command(label=str(self.dispG.node[n]['dataG_id']),
                  state=state,
                  command=lambda item=item, n=n: self.hide_behind(item, n))

        popup.add_cascade(label='Hide Behind', menu=hide_behind)

        token = self.dispG.node[item]['token']
        token.customize_menu(popup, item)

        try:
            popup.post(event.x_root, event.y_root)
        finally:
            popup.grab_release() 
开发者ID:jsexauer,项目名称:networkx_viewer,代码行数:35,代码来源:graph_canvas.py

示例10: login

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [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

示例11: cooldown

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [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

示例12: outvarchanged

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [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

示例13: themevarchanged

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [as 别名]
def themevarchanged(self):
        self.theme_button_0['foreground'], self.theme_button_1['foreground'] = self.theme_colors

        state = self.theme.get() and tk.NORMAL or tk.DISABLED
        self.theme_label_0['state'] = state
        self.theme_label_1['state'] = state
        self.theme_button_0['state'] = state
        self.theme_button_1['state'] = state 
开发者ID:EDCD,项目名称:EDMarketConnector,代码行数:10,代码来源:prefs.py

示例14: hotkeylisten

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [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

示例15: _leave

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import DISABLED [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


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