0
我有这个列表框作为类的一部分:在标签Python3 Tkinter的显示列表框项目时,点击
def myListbox(self):
selection = Label(self, text="Please select Country").grid(row=0,column=0)
countries = Listbox(self, width = 20, height = 75)
countries.grid(row=0, column=1)
# I have a function that populates the country names from
# a text file and displays the names in the Listbox.
# I want to be able to select a country from the Listbox
# and have it displayed in a Label
country_display = Label(self, text = "").grid(row = 0, column = 9)
# this is where I'm not sure what code to use.
# my code is
countries.bind("<<ListboxSelect>>",country_display)
目前什么都不显示。我在这里错过了什么? 谢谢