Python GUI Tutorial - 26 - Listbox - selectmode - part 2 | Tkinter
12.7 هزار بار بازدید -
6 سال پیش
-
In this video you'll learn
In this video you'll learn how we can use different select modes in Listbox in tkinter.
There are 4 different types of select modes are available in tkinter's List box -
1. BROWSE- That is by default select mode of list box in tkinter, in this the selection will follow the cursor if left mouse button is clicked at the same time.
2. SINGLE - It is used to select a single item from the list box.
3. MULTIPLE - It is used to select multiple lines from the list box.
4. EXTENDED - it is used to select multiple adjacent item/lines in the list box.
program or code used in the video -
from tkinter import *
root = Tk()
l = Listbox(root, width=30, height=15, selectmode= EXTENDED)
l.insert(1, "C++")
l.insert(2, "C#")
l.insert(3, "Python")
l.insert(4, "Java")
l.insert(5, "Javascript")
l.pack()
root.geometry("400x400+120+120")
root.mainloop()
---------------------------------
so i am sure that your queries like-
- how to use select mode in list box in tkinter?
- how to use multiple items or lines in listbox in tkinter?
- how to copy group of lines or items in listbox in tkinter?
have been solved.
if you have any problem related with this video then please comment b
There are 4 different types of select modes are available in tkinter's List box -
1. BROWSE- That is by default select mode of list box in tkinter, in this the selection will follow the cursor if left mouse button is clicked at the same time.
2. SINGLE - It is used to select a single item from the list box.
3. MULTIPLE - It is used to select multiple lines from the list box.
4. EXTENDED - it is used to select multiple adjacent item/lines in the list box.
program or code used in the video -
from tkinter import *
root = Tk()
l = Listbox(root, width=30, height=15, selectmode= EXTENDED)
l.insert(1, "C++")
l.insert(2, "C#")
l.insert(3, "Python")
l.insert(4, "Java")
l.insert(5, "Javascript")
l.pack()
root.geometry("400x400+120+120")
root.mainloop()
---------------------------------
so i am sure that your queries like-
- how to use select mode in list box in tkinter?
- how to use multiple items or lines in listbox in tkinter?
- how to copy group of lines or items in listbox in tkinter?
have been solved.
if you have any problem related with this video then please comment b
6 سال پیش
در تاریخ 1397/05/01 منتشر شده
است.
12,772
بـار بازدید شده