本文整理汇总了Python中Tkinter.Checkbutton.bind方法的典型用法代码示例。如果您正苦于以下问题:Python Checkbutton.bind方法的具体用法?Python Checkbutton.bind怎么用?Python Checkbutton.bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.Checkbutton
的用法示例。
在下文中一共展示了Checkbutton.bind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MakeCB
# 需要导入模块: from Tkinter import Checkbutton [as 别名]
# 或者: from Tkinter.Checkbutton import bind [as 别名]
def MakeCB(self, cb_ptr, text, evt_type, arg, csp=1, stky=W):
cb_ptr = Checkbutton(self, text=text)
cb_ptr.bind(evt_type, lambda event, arg=arg: self.toggle_cb(event, arg))
if self.orig[arg]:
cb_ptr.select()
cb_ptr.grid(row=self.row, column=self.col, columnspan=csp, sticky=W)
self.row += 1
示例2: __init__
# 需要导入模块: from Tkinter import Checkbutton [as 别名]
# 或者: from Tkinter.Checkbutton import bind [as 别名]
def __init__(self, parent):
Frame.__init__(self, parent)
self.parent = parent
self.buttons = {}
self.nodes = {}
self.edges = {}
self.active_node = None
self.active_edge = None
self.start = None
self.x = None
self.y = None
self.cycles = None
self.show_cycles_only_mode = False
self.steps = None
self.step_index = None
self.parent.title("Demonstrační aplikace - nalezení elementárních cyklů v orientovaném grafu")
self.style = Style()
self.style.theme_use("default")
self.pack(fill=BOTH, expand=1)
self.columnconfigure(1, weight=1)
self.columnconfigure(3, pad=7)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, pad=7)
self.label = Label(self, text="graf1.graphml")
self.label.grid(sticky=W, pady=4, padx=5)
self.canvas = Canvas(self)
self.canvas.bind('<Double-Button-1>', self.event_add_node)
self.canvas.bind('<Button-1>', self.event_add_edge_start)
self.canvas.bind('<B1-Motion>', self.event_add_edge_move)
self.canvas.bind('<ButtonRelease-1>', self.event_add_edge_end)
self.canvas.bind('<Button-3>', self.event_move_node_start)
self.canvas.bind('<B3-Motion>', self.event_move_node)
self.canvas.pack()
self.canvas.grid(row=1, column=0, columnspan=2, rowspan=6,
padx=5, sticky=E + W + S + N)
self.buttons['start'] = b = Button(self, text="Start", width=15)
b.bind('<Button-1>', self.event_start)
b.grid(row=1, column=3)
self.buttons['next'] = b = Button(self, text=">>", width=15, state=DISABLED)
b.bind('<Button-1>', self.event_next_step)
b.grid(row=2, column=3, pady=4)
self.buttons['prev'] = b = Button(self, text="<<", width=15, state=DISABLED)
b.bind('<Button-1>', self.event_prev_step)
b.grid(row=3, column=3, pady=4)
b = Checkbutton(self, text="Pouze cykly", command=self.event_change_mode)
b.grid(row=4, column=3, pady=4)
self.buttons['reset'] = b = Button(self, text="Reset", width=15)
b.bind('<Button-1>', self.event_reset)
b.grid(row=6, column=3)
menubar = Menu(self.parent)
self.parent.config(menu=menubar)
fileMenu = Menu(menubar)
fileMenu.add_command(label="Načíst", command=self.onLoad)
fileMenu.add_command(label="Uložit", command=self.onSave)
fileMenu.add_separator()
fileMenu.add_command(label="Konec", command=self.onExit)
menubar.add_cascade(label="Soubor", menu=fileMenu)
fileMenu = Menu(menubar)
fileMenu.add_command(label="O aplikaci", command=self.onAbout)
menubar.add_cascade(label="Nápověda", menu=fileMenu)
示例3: Scrollbar
# 需要导入模块: from Tkinter import Checkbutton [as 别名]
# 或者: from Tkinter.Checkbutton import bind [as 别名]
acceptStatesTextVariable=StringVar()
acceptStatestEntry = ttk.Entry(innersampleFrame,width=4,textvariable=acceptStatesTextVariable)
acceptStatestEntry.grid(column=1 , row=1, sticky="e")
listFrame=ttk.LabelFrame(sampleFrame)
listFrame.grid(column=0,row=1,sticky="ewns")
scrollBar = Scrollbar(listFrame)
scrollBar.pack(side=RIGHT, fill=Y)
listBoxTop = Listbox(listFrame, selectmode=SINGLE,width=10,height=5)
listBoxTop.pack(fill=BOTH)
scrollBar.config(command=listBoxTop.yview)
listBoxTop.config(yscrollcommand=scrollBar.set)
sampleInputOption=Checkbutton(listFrame,text='Display Automata',variable=sInputCheck)
sampleInputOption.pack(side=tk.LEFT, fill='x',anchor='w')
sampleInputOption.bind('<ButtonRelease-1>',displaysampleAutomata)
nb.add(master_bar, text="Sample Input")
def generateSampleAutomata():
try:
import time
start_time=time.time()
if len(samplePad.get())<2:
tkMessageBox.showerror("Empty trace","Sample trace is empty.Please select a trace log.")
return
#try:
text_FromTextBox(samplePad.get().split(','))
statsPad.configure(state='normal')
from ktail import kTails