Bind Ctrl-Q as a global hotkey to exit. Bind Ctrl-W as a hotkey to close

dialogs.
This commit is contained in:
jhb 2014-11-04 16:30:42 +00:00
parent 7cf2ae8ad6
commit 0b0514e889

View File

@ -286,6 +286,10 @@ def __init__(self, table, name):
color = graph.getcolor(type[0])
if (color != ""):
self.additem(type[0], color)
self.bind("<Control-w>", self.destroycb)
def destroycb(self, event):
self.destroy()
def additem(self, name, color):
item = ColorConf(self.items, name, color)
@ -371,6 +375,10 @@ def __init__(self):
self.addsource(source)
self.drawbuttons()
self.buttons.grid(row=1, column=0, sticky=W)
self.bind("<Control-w>", self.destroycb)
def destroycb(self, event):
self.destroy()
def addsource(self, source):
if (self.irow > 30):
@ -485,6 +493,10 @@ def __init__(self, source):
bd=1, relief=SUNKEN, width=10).grid(
row=ypos, column=3, sticky=W+E)
ypos += 1
self.bind("<Control-w>", self.destroycb)
def destroycb(self, event):
self.destroy()
class SourceContext(Menu):
@ -527,6 +539,7 @@ def __init__(self, event, canvas):
self.drawbuttons()
event.displayref(canvas)
self.bind("<Destroy>", self.destroycb)
self.bind("<Control-w>", self.destroycb)
def destroycb(self, event):
self.unbind("<Destroy>")
@ -1307,6 +1320,10 @@ def __init__(self, master):
self.pack(expand=1, fill="both")
self.buildwidgets()
self.layout()
self.bind_all("<Control-q>", self.quitcb)
def quitcb(self, event):
self.quit()
def buildwidgets(self):
global status