aus einem Tutorial habe ich folgendes abgeändert:
Code: Alles auswählen
from tkinter import *
from tkinter.ttk import Combobox
def main():
query()
return
def query():
root = Tk()
root.title("Combobox")
CoBoListe = ["wählen", "Alpha", "Bravo", "Charlie", "Delta", "Foxtrott", "Hotel", "Golf"]
But = Button(root, text='Quit', command=root.quit)
CoBo = Combobox(root, height = 5, width = 15, values = CoBoListe)
CoBo.pack()
But.pack()
CoBo.set(CoBoListe[0])
CoBo.bind("<<ComboboxSelected>>", CoBoOut)
root.mainloop()
root.destroy()
return
def CoBoOut(event):
# wie komme ich hier an das Selektierte ran ?
return
if __name__ == "__main__":
main()
Gruß
Mathias