How to Create Scrollbars Using Python! - Tkinter

preview_player
Показать описание
In this tutorial I will be showing you how to create SCROLLBARS using Python. This is a step-by-step detailed tutorial made to help you increase your understanding of Python.

Order of Video:
00:00 - 00:44 = Introduction and Explanation
00:44 - 08:02 = Writing the Code
08:02 - END = Conclusion

Subscribe to my YouTube channel "AnalystRising" for more amazing stuff!!

I get lots of people asking me for the source code so I will now be posting it in the comments below. If it is not there then please let me know!

I have more videos available on Arduinos and Excel ready for viewing!!

This channel is about learning to code and analyse data in small bitesize amounts. As a result, larger projects come as a series which I put as a playlist. A link to some of my playlists can be found below.

Create PowerPoint Presentations Only Using Python

Build a Music Player using Python

Learn Regression Modelling from scratch

Basic graphing with Python

Building Network Graphs using Python

PLEASE NOTE:
My Python Shell may be different to yours and may be set-up in a different way.  Doing various things such as installing packages/modules may be different for you.
Рекомендации по теме
Комментарии
Автор

hello sir. i want to add canvas, images, and various widgets to my parent window and i want my PARENT WINDOW to be scroll-able using scrolllbar. can you provide with the code, how i can do that?

raveeshmalhotra
Автор

Hello! Thank you for the video! How can I create the same scrollbar for multiline TextInput in Kivy? Is it impossible? Yesterday the whole day I searched it, but couldn't find. Please, help me!

umidjonsadatov
Автор

Great video, I hated it a bit because of all the ads.

sidtheloser
Автор

SOURCE CODE BELOW!!


"""
SCROLLBARS!!
"""

import tkinter as tkr



"""TextBox Text: TxtBox"""

TextItems_Vertical =
TextItems_Horizontal = ("1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30\n")


"""Window Set-up"""

window = tkr.Tk()
window.geometry("250x200")


"""Create Vertical Scrollbar"""

SBar = tkr.Scrollbar(window)
SBar.pack(side=tkr.RIGHT, fill="y")


"""Create Horizontal Scrollbar"""
SBar2 = tkr.Scrollbar(window, orient = tkr.HORIZONTAL)
SBar2.pack(side=tkr.BOTTOM, fill="x")



"""Create Text Box"""

TxtBox = tkr.Text(window, height = 500, width = 350, yscrollcommand = SBar.set, xscrollcommand = SBar2.set, wrap = "none")
TxtBox.pack(expand=0, fill= tkr.BOTH)


"""Insert Text Into TextBox"""
TxtBox.insert(tkr.END, TextItems_Horizontal)
TxtBox.insert(tkr.END, TextItems_Vertical)

"""Link Scrollbar to TextBox"""



"""Activate!"""

window.mainloop()

AnalystRising