Python Forum

Full Version: tkiinter combobox selection problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
so i am working on converter app so there is two comboboxes so there is meter is default value in combbox1 and kilometer value in combobox 2 and i have used ComboboxSelected event and check the condition if it match the condition then call the function. but problem is that as kilometer is default value. when i put value and press enter it doesn't work because i have not selected kilometer myself. so is there a solution that it will work without selceting default value again from combobox.
selection = StringVar(root)
selection_values = ['Meter to Foot', 'Foot to Meter']
selection.set(selection_values[0]) # this sets the Combobox to the first element of the list

selection_box = Combobox(root, values=selection_values, textvariable=selection)
# your event detection with Combobox
selection_box.pack()
You need to post your code. Without it no-one will be able to help you.