Tkinter is Python's most popular Graphical User Interface (GUI) library. This topic explains the proper use of this library and its resources.
Python Tkinter: How to create a ScrolledText in Tkinter
Support the Channel šš:
Buy me a coffee ā : https://buymeacoffee.com/usandopython
ā”ļø Connect with me on:
Instagram: https://www.instagram.com/pybeginners/
Twitter: https://x.com/joaofuti_
LinkedIn: https://www.linkedin.com/in/joao-futi-muanda-16b980175/
Website: https://www.usandopy.com/en
Thread: https://www.threads.net/@pybeginners
Show More Show Less View Video Transcript
0:00
hello guys welcome back to the channel
0:01
my name is J so today we are going to
0:03
create roller test in Python tint okay
0:06
so let's say that you have a big test
0:08
okay a huge test that you want to show
0:10
in your application in your app so for
0:13
that is very easy we can use a scroll
0:15
test okay scroll test because it will
0:17
give us a scroll bar that we can scroll
0:19
down and up to see better the test oh
0:22
sorry where I was okay okay I was okay
0:25
yes so this is what we are going to
0:27
create in this uh episode okay so we are
0:30
going to perform okay how how we can
0:32
create a scroll test how we can show
0:34
scroll test in the window how we can
0:35
insert and delete items inside of the
0:38
scroll test okay because this is a huge
0:40
test that's that's why scroll test is
0:42
needed to show or to display those test
0:45
okay so let's go to our test editor and
0:49
let's start working on it okay so for
0:52
that let's come here so in order to
0:54
create a scroll test we have to do
0:56
something like that okay let me delete
0:57
those guys okay we don't need them boom
0:59
bye-bye in order to create a scroll test
1:02
okay i'm just going to keep this button
1:04
because we might need it okay and let me
1:07
delete this uh list okay and I will keep
1:10
also this function because we might need
1:12
it so in order to create a scroll test
1:14
indicator we have to do something like
1:16
that okay so let's say tst let's create
1:18
one variable called test okay then we
1:22
have to call the scroll test okay but
1:23
first let's import it the scroll test
1:25
okay let's say from TK enter okay from
1:29
TK enter
1:30
import okay scrolled scroller test this
1:34
guy okay everything is small save okay
1:38
now if I come here if I come here okay
1:40
let me get this guy and I keep it boom
1:43
scroller test dot then again scrolled
1:49
capital okay
1:50
scrolled let me say is this name itself
1:53
okay scroll test open and close but this
1:55
guy must be capital okay the first one
1:58
and boom capital save and if I run this
2:01
I'm going to get a rocket so I think I
2:04
wrote it bad let me see scroll test did
2:06
you mean scroll test oh yes I forget
2:09
this T must be capital also capital save
2:12
and if I run this boom now everything is
2:16
working okay perfect so after that we
2:19
just need to give this scroller testing
2:22
into our wind okay so let's give it
2:26
window
2:28
comma okay then let's define also width
2:31
which is very important for sol test the
2:33
width let's say
2:34
40 so that's not and the height okay
2:38
height will be equal at least 10 it's
2:41
enough okay save uh now after that we
2:44
need to
2:46
uh to show okay we need to place this
2:49
scroller test inside of our windows for
2:50
that let's say test will be dot okay let
2:54
me reuse this guys I'm just going to use
2:56
this copy and I paste it okay row zero
3:01
column let's use column zero again also
3:03
boom zero save if I run this boom now we
3:07
have here our scroll test you can see
3:08
there is a scroll bar and here is our
3:11
test where we can show we can write some
3:13
stuff lot of stuff and we can give space
3:16
so this is how we can create a scroll
3:18
test in Python ticking Enter okay done
3:22
so now the thing is how we can insert uh
3:26
test inside of our scroll test so to
3:28
insert test inside of scroll test is
3:30
very easy we can just use the test dot
3:34
insert okay insert open and close okay
3:39
so here the first word that we have to
3:41
give the first argument must be insert
3:43
everything capital okay comma then this
3:46
will be the test that we want to insert
3:48
so let's say something like uh any test
3:51
oh where can I get any test okay uh blah
3:53
blah blah blah okay i can reuse this one
3:55
from the book itself i come
3:59
here okay let me copy all this
4:02
stuff mhm i'm going to copy this come
4:06
back and I just keep it
4:09
okay i didn't miss okay now this guy
4:12
just need to go
4:14
up
4:15
comma this guy just need to go up
4:19
comma you do
4:22
comma and you also is this
4:28
okay comma
4:34
okay yeah so this is all the test that
4:38
we want to insert in our scroll test
4:40
okay save now if I save and I run this
4:43
boom now we can see we have all those
4:45
stuff okay so but the scroll bar is not
4:46
showing because it didn't cross the
4:48
limit so let's try to copy this guy
4:51
again
4:54
boom comma okay comma yeah now I put a
4:59
lot of stuffs there let's see save and
5:01
if I run
5:03
this if I run this okay the scroll
5:06
scroll bar is working okay if I do this
5:09
you can see it is working okay but this
5:11
one is not activated because uh we
5:13
didn't use the full edge okay that's why
5:16
but if I do this scroll bar is working
5:18
okay it's you can go up and down up and
5:21
down so this is how you can you uh
5:23
insert uh information inside of the
5:25
scroll text so now uh to delete
5:30
information inside of the scroll test
5:31
it's very easy okay so we just have to
5:34
call the same variable test dot delete
5:38
dot delete okay open and close so now
5:40
here we just have to give okay the range
5:43
that we want to delete so for them let's
5:44
say for them from one okay from
5:48
1.0 at least 1.0 comma up to and save if
5:54
I run this boom everything is gone so
5:57
this is how you can delete the things
6:00
from the scroller test okay in Python
6:02
tick so as always I'll keep the link of
6:05
an article which talked about this in
6:07
the in the description of this video
6:08
okay so if you are interested to know
6:10
more about scholar test just go there
6:12
and learn more from there okay so my
6:14
name is John if you like this video hit
6:16
the like button and subscribe to the
6:18
channel and see you in the next video
6:20
okay bye-bye
#Programming

