如何在列表框中选择多个项目?

时间:2017-04-08 17:09:35

标签: python linux tkinter listbox

我有一个列表框:

    self.listBox = Listbox(self.master,              
                           height = 34,
                           width = 38)

    self.listBox.grid(row = 3, column = 0, rowspan = 7, sticky = W)

列表框中有很多项目。当用鼠标选择时,我试着通过按住键盘上的ctrl或shift键来选择其中两个,但似乎默认情况下不能选择多个项目。我怎样才能克服这个问题?

我在Linux Mint Xfce上使用Python 3.5。

1 个答案:

答案 0 :(得分:2)

试试这个

self.listBox =Listbox(self.master, 
                       selectmode='multiple',              
                       height = 34,
                       width = 38)
相关问题