Python Forum
[Tkinter] Updating box with Drop Down selection
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Updating box with Drop Down selection
#4
(May-12-2020, 04:04 PM)Yoriz Wrote: The line
Display1.insert(END, DropVal)
passes a reference to DropVal as it is not called with ()

If the function DropVal was called, it does not return anything so None would be returned.

Thanks heaps for your comment

I have changed the if statement to be:

if Drop==options[1]:
        weightlist = [0]
        Display1.set(weightlist[0]) 

# Lists

options=[
    "Please Select a Destination",
    "Destinationone",
    "Destinationtwo",
    "Destinationthree",
    "Destinationfour",
    "Destinationfive",
    "Destinationsix",
    "Destiinationseven",
    "Destinationeight"
    ]

weightlist=[
    0.3,
    0.9,
    0.16,
    0.3,
    0.18,
    0.13,
    0.14,
    0.12,
    ]
I am trying to work out if a user selects 'Destinationone' how to display the number in weightlist 0.3.

Would you have any ideas on how i can do this?
Reply


Messages In This Thread
Updating box with Drop Down selection - by RCC99 - May-12-2020, 10:25 AM
RE: Updating box with Drop Down selection - by RCC99 - May-13-2020, 09:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Kivy] Create a function to store text fields and drop downs selection in KivyMD floxia 0 1,688 Dec-18-2022, 04:34 AM
Last Post: floxia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020