Bind escape button to quit.

This commit is contained in:
voussoir 2021-07-04 22:22:10 -07:00
parent 684dcbb234
commit 05d1eb745e
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -28,6 +28,7 @@ class PGUILauncher(tkinter.ttk.Frame):
self.filter_entry = tkinter.Entry(self, textvariable=self.filter_var)
self.filter_entry.grid(row=0, column=0, columnspan=999, sticky='ew')
self.filter_entry.bind('<Return>', self.launch_filtered)
self.filter_entry.bind('<Escape>', self.quit)
self.filter_entry.focus()
x = 0
@ -80,6 +81,9 @@ class PGUILauncher(tkinter.ttk.Frame):
subprocess.Popen(command, shell=True)
self.quit()
def quit(self, *args):
return super().quit()
def main(argv):
root = tkinter.Tk()