Rpi Tkinter Window, I Want To Use A Command Like Overrideredirect And Maintain Entry Box Functionality
When using overrideredirect or something like root.wm_attributes('-type', 'splash') my entry box cannot get focus on user's click. I am developing a GUI which I want to maintain th
Solution 1:
When using the splash window type (Linux only), you can make the entry get the keyboard focus by using focus_force()
, e.g. binding it to the left click.
import tkinter as tk
root = tk.Tk()
root.wm_attributes('-type', 'splash')
e = tk.Entry(root)
e.pack()
# force focus on left click:
root.bind('<1>', lambda ev: ev.widget.focus_force())
root.mainloop()
Post a Comment for "Rpi Tkinter Window, I Want To Use A Command Like Overrideredirect And Maintain Entry Box Functionality"