本文整理匯總了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()
示例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])
示例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
示例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])
示例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()
示例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
示例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
示例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")
示例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()
示例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()
示例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)
示例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
示例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
示例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
示例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