From 9799411bf7efe37d07a9e82d3e579d7162118cd5 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 4 Nov 2014 16:30:42 +0000 Subject: [PATCH] Bind Ctrl-Q as a global hotkey to exit. Bind Ctrl-W as a hotkey to close dialogs. --- tools/sched/schedgraph.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py index 007c9f4c8896..f1ce3c61a3ea 100644 --- a/tools/sched/schedgraph.py +++ b/tools/sched/schedgraph.py @@ -286,6 +286,10 @@ def __init__(self, table, name): color = graph.getcolor(type[0]) if (color != ""): self.additem(type[0], color) + self.bind("", 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("", 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("", 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("", self.destroycb) + self.bind("", self.destroycb) def destroycb(self, event): self.unbind("") @@ -1307,6 +1320,10 @@ def __init__(self, master): self.pack(expand=1, fill="both") self.buildwidgets() self.layout() + self.bind_all("", self.quitcb) + + def quitcb(self, event): + self.quit() def buildwidgets(self): global status