Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OptionMenu in fullscreen with touchscreen doesn't work #2688

Open
szubakwarc opened this issue Feb 17, 2025 · 0 comments
Open

OptionMenu in fullscreen with touchscreen doesn't work #2688

szubakwarc opened this issue Feb 17, 2025 · 0 comments

Comments

@szubakwarc
Copy link

szubakwarc commented Feb 17, 2025

Hi.

I am developing appusing customtkinter on rapsberry pi 4b with touch screen and I stuck on OptionMenu probem. The problem is that when I open the application in full screen (by various methods) it causes the drop-down menu to be unresponsive. It expands when touched, but I can't select any of the items, whereas when I use the mouse everything is ok.
I am anxious to use this widget, so ideas on what could be wrong and how to solve this problem are welcome. Sample code below:

import customtkinter as ctk

root = ctk.CTk()
root.title("CustomTkinter Example")
root.geometry('600x400')
'''
root.attributes("-fullscreen", True)

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
root.geometry(f"{screen_width}x{screen_height}+0+0")
root.overrideredirect(True)
'''
root.bind_all("", lambda e: root.destroy())

def update_label(event):
label.configure(text="Selected Option: " + optionmenu.get())
options = ["Option 1", "Option 2", "Option 3"]
optionmenu = ctk.CTkOptionMenu(root, values=options, command=update_label, font=("Arial", 20), dropdown_font=("Arial", 20))
optionmenu.pack()

label = ctk.CTkLabel(root, text="Selected Option: ", font=("Arial", 20))
label.pack()

if name == "main":
root.mainloop()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant