horizontal scrollbar tkinter using grid

Solutions on MaxInterview for horizontal scrollbar tkinter using grid by the best coders in the world

showing results for - "horizontal scrollbar tkinter using grid"
Adrián
26 Jan 2020
1from tkinter import *
2
3ws = Tk()
4ws.title('PythonGuides')
5ws.geometry('400x300')
6ws.config(bg='#4A7A8C')
7
8frame = Frame(ws)
9frame.pack(expand=True, fill=BOTH, padx=20, pady=20)
10
11lb = Listbox(
12    frame,
13    font= (12)
14    )
15lb.pack(expand=True, fill=BOTH)
16
17sb = Scrollbar(
18    frame, 
19    orient=HORIZONTAL
20    )
21sb.pack(fill=X)
22
23lb.configure(xscrollcommand=sb.set)
24sb.config(command=lb.xview)
25
26lb.insert(0, 'Not all heros wear capes.')
27lb.insert(1, 'Game changers are in blue')
28lb.insert(2, 'With great power comes great responsibility')
29lb.insert(3, 'A noun phrase has a noun or pronoun as the main word')
30lb.insert(4, 'With great power comes great responsibility')
31lb.insert(5, 'contribute to open source, as this will help & motivate you.')
32
33ws.mainloop()