[Python] Como configurar cada item do combobox do tkinter para ter um resultado diferente dos...

Discussão em 'Python' iniciado por Stack, Fevereiro 3, 2025.

  1. Stack

    Stack Membro Participativo

    Bom, eu criei um combobox porém não sei como configurar um item individualmente.

    import tkinter as tk
    from tkinter.tix import IMAGETEXT
    from PIL import ImageTk, Image
    from tkinter import messagebox, ttk
    import shelve
    from urllib.request import urlopen


    root = tk.Tk()
    root.title("Aplicativo de Organização")
    root.geometry('1600x900')
    root.configure(background="ghost white")


    label = tk.Label(root ,text ='Qual a sua série?', font=' Verdana 25', background="ghost
    white")
    label.place(relx = 0.40,
    rely = 0.01,
    anchor ='nw',)

    combo = ttk.Combobox(
    values=["4 ano", "5 ano", "6 ano", "7 ano", '8 ano', '9 ano', '1 série', '2 serie', '3
    serie', 'Não selecionado'],

    )

    combo.current(9)

    combo.place( anchor ='center', rely=.1, relx=.48, width=200, height=29)

    root.mainloop()

    Continue reading...

Compartilhe esta Página