Author: jhb
Date: Tue Nov  4 16:30:42 2014
New Revision: 274091
URL: https://svnweb.freebsd.org/changeset/base/274091

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

Modified:
  head/tools/sched/schedgraph.py

Modified: head/tools/sched/schedgraph.py
==============================================================================
--- head/tools/sched/schedgraph.py      Tue Nov  4 16:02:46 2014        
(r274090)
+++ head/tools/sched/schedgraph.py      Tue Nov  4 16:30:42 2014        
(r274091)
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to