from tkinter import *
from tkinter.ttk import *
month = (1,2,3,4,5,6,7,8,9,10,11,12)
def func1(self,event = None):
var = self.CB1.get()
print(var)
print("Your Birthday is: " + var)
class app():
def __init__(self):
window = Tk()
self.CB1 = Combobox(window,values = month,state = "readonly")
self.CB1.current(0)
self.CB1.bind("<<ComboboxSelected>>", func1(self,event = None))
self.CB1.pack()
window.mainloop()
app()
So it will output 1, and say "Your birthday is 1", it will not do it again if I select a different number. I have tried over 10 different pages to understand combo-boxes, and am failing quite hard to understand. Any help would be appreciated. Thank you to all who help.