<< List Box Select >>不在python中显示

时间:2019-12-22 01:14:57

标签: python tkinter

im使用python开发库管理系统, 并且这部分不起作用,这在文本框中没有显示值

scrollbar = Scrollbar(DataFrameRIGHT)
    scrollbar.grid(row=0,column=1,sticky='ns')

    ListOfBooks = ['Gamperliya','Heen Saraya','Kantharaye Kusuma','Madol Duuwa','Yuganthaya','Kaliyugaya',
                   'Viragaya','Hapana','Ape Gama','Sirimath','Vilambeetha','Guru Geethaya','Miriguwa',
                   'Upanda Sita Baala Wiya','Thrilooka Wijaya Pathra','Bahirawa Kande Nidanaya']

    def SelectedBook(evt):
        value =str(booklist.get(booklist.curselection()))
        w = value

    if W == "Gamperliya":
        BookID.set("ISBN 74857898799")
        iReceipt()

    booklist = Listbox(DataFrameRIGHT, width=20, height=12, font=('arial', 12, 'bold'))
    booklist.bind('<<ListBoxSelect>>',SelectedBook)
    booklist.grid(row=0,column=0,padx=8)
    scrollbar.config(command=booklist.yview)

    for items in ListOfBooks:
        booklist.insert(END,items)

0 个答案:

没有答案