1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Tkinter dropdown opens on top left of my screen

Discussão em 'Python' iniciado por Stack, Setembro 16, 2025.

  1. Stack

    Stack Membro Participativo

    I have this simple tkinter script. But when I test it, the dropdown doesn't open below the combobox, but on the top left of my monitor (not top left of the application window). Any ideas why? I didn't really find anything on the internet. I use Python 3.13 on Windows 11.

    from tkinter import *
    from tkinter import ttk

    root = Tk()
    root.geometry("200x200")

    def show():
    lbl.config(text=cb.get())

    # Dropdown options
    a = ["Apple", "Banana", "Cherry", "Date", "Elderberry"]

    # Combobox
    cb = ttk.Combobox(root, values=a)
    cb.set("Select a fruit")
    cb.pack()

    # Button to display selection
    Button(root, text="Show Selection", command=show).pack()

    # Label to show selected value
    lbl = Label(root, text=" ")
    lbl.pack()

    root.mainloop()


    Screenshot of the problem

    EDIT: OptionMenu works fine, it opens below the OptionMenuButton. But I need this Multiple Selection Dropdown from Combobox :/

    Continue reading...

Compartilhe esta Página