Python Tkinter Overrideredirect; Cannot Receive Keystrokes (Linux)
I have a python tkinter application which I want to run full screen. When I uncomment overrideredirect, the window manager (Gnome, Linux) will not be able to forward keystrokes to
Solution 1:
This works for the use case where you're using overrideredirect to get fullscreen, which is somewhat common:
#self.root.overrideredirect(1)
self.root.attributes('-fullscreen', True)
Solution 2:
You might want to enter the callable self.root.quit
instead of self.root.quit()
when you do the binding to avoid calling the function. when you will press Escape the callable will be called (I know I know) with an event argument. If self.root.quit()
does not accept any argument: use lambda: self.root.bind('<Escape>',lambda e:self.root.quit())
Post a Comment for "Python Tkinter Overrideredirect; Cannot Receive Keystrokes (Linux)"