0

If I include either win.attributes('-type', 'dock') or win.overrideredirect(True) i can hide the title bar of my gui but the left key bind stops working. How do i hide the title bar but still keep my key binding?

from tkinter import *

def leftKey(event):
    print ("Left key pressed")


win = Tk()

win.geometry("600x400")
#win.attributes('-type', 'dock')
#win.overrideredirect(True)
win.bind('<Left>', leftKey)
Richard
  • 69
  • 8
  • It works fine in Windows 7 when `win.overrideredirect(True)` is called. – acw1668 May 19 '20 at 05:43
  • Thanks, that's interesting... I'm running this on Raspian and no joy – Richard May 19 '20 at 06:34
  • found another post https://stackoverflow.com/questions/39529600/remove-titlebar-without-overrideredirect-using-tkinter using ```win.wm_attributes('-type', 'splash')``` but this method also breaks the key binding – Richard May 20 '20 at 08:53
  • 1
    ***running this on Raspian***: More interesting, which **Window manager** are used? Does this answer your question? [tkinters-overrideredirect-prevents-certain-events-in-mac-and-linux](https://stackoverflow.com/questions/34582637) – stovfl May 20 '20 at 09:08
  • Desktop session: LXDE-pi, XDG current desktop: LXDE, Window manager: Openbox. I will have a look if this tkinters-overrideredirect-prevents-certain-events-in-mac-and-linux can help me – Richard May 20 '20 at 09:33
  • @stovfl devilspie works nicely, the window shows the title for milliseconds and then devilspie strips it away. Thank you – Richard May 20 '20 at 18:10
  • Cosider to close the question as duplicate – stovfl May 20 '20 at 18:16

0 Answers0