diff options
author | John Baldwin <jhb@FreeBSD.org> | 2014-11-04 16:30:42 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2014-11-04 16:30:42 +0000 |
commit | 9799411bf7efe37d07a9e82d3e579d7162118cd5 (patch) | |
tree | f1967caf6061b2b096f7ea3104fdeb958602971b /tools/sched | |
parent | aec1a09487e955b151c5bb891ee4569d2cbfaf9c (diff) | |
download | src-test-9799411bf7efe37d07a9e82d3e579d7162118cd5.tar.gz src-test-9799411bf7efe37d07a9e82d3e579d7162118cd5.zip |
Bind Ctrl-Q as a global hotkey to exit. Bind Ctrl-W as a hotkey to close
dialogs.
Notes
Notes:
svn path=/head/; revision=274091
Diffstat (limited to 'tools/sched')
-rw-r--r-- | tools/sched/schedgraph.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py index 007c9f4c88963..f1ce3c61a3ea2 100644 --- a/tools/sched/schedgraph.py +++ b/tools/sched/schedgraph.py @@ -286,6 +286,10 @@ class ColorConfigure(Toplevel): 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 @@ class SourceConfigure(Toplevel): 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 @@ class SourceStats(Toplevel): 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 @@ class EventView(Toplevel): 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 @@ class SchedGraph(Frame): 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 |