Scrollable Frames!! - Tkinter CustomTkinter 8

  Рет қаралды 17,388

Tkinter․com

Tkinter․com

Күн бұрын

In this video I'll show you how to use scrollable frames with CustomTkinter and Python.
In regular Tkinter, you need to add a scrollbar to a frame to make it scrollable, but in CustomTkinter there's a widget that comes with a scrollbar!
So no extra coding! Let's dive into it!
#tkinter #codemy #JohnElder
Timecodes
0:00​​ - Introduction
1:25 - Create Scrollable Frame
2:06 - Add Buttons
3:46 - Change Scrollbar to Horizontal
5:18 - Change Height/Width of Frame
5:43 - Add Frame Label
6:13 - Change Label FG Color
6:41 - Change Label Text Color
7:03 - Change Label Font Size
7:22 - Change Label Text Position
8:28 - Change Frame Border
9:04 - Change Frame Border Color
9:43 - Change Frame FG Color
10:05 - Change Scrollbar FG Color
10:41 - Change Scrollbar Button Color
11:06 - Change Scrollbar Hover Color
11:40 - Change Frame Corner Radius
13:00 - Conclusion

Пікірлер: 32
@TkinterPython
@TkinterPython 10 ай бұрын
▶ Watch CustomTkinter Playlist ✅ FREE Tkinter Widget Book bit.ly/45iO4OP bit.ly/3K4qlZC ▶ See More At: ✅ Subscribe To My KZbin Channel: Tkinter.com bit.ly/3Pk1By4 ▶ MASSIVE TKINTER.COM DISCOUNT ✅ Join My Facebook Group: 30% off with coupon code: youtube bit.ly/2GFmOBz ▶ Get The Code For This Video bit.ly/3dCzz2K
@rachelpiteck
@rachelpiteck 3 күн бұрын
I just want to say that I love your videos! It got me back into coding for fun. I have really enjoyed using Tkinter for some dnd programs I am doing. I usually use python for physics but it has been way fun getting into tkinter. Thank you for the great tuturials!!!
@Ev-001
@Ev-001 2 ай бұрын
You are a godsend, I have been fighting with scrollable on TK for weeks, trying all sorts of different things to get it to work. My structure was already prepared for scrollableframe from CTK so simply changing from frame fixed my issue!
@Codemycom
@Codemycom 2 ай бұрын
Glad you found me then!
@sulaimonmueezoluwaseun4145
@sulaimonmueezoluwaseun4145 10 күн бұрын
I am doing self-learning, and I have completed many tasks using your channel. i am looking out for projects and wish to work with experts
@YusifRefae
@YusifRefae 3 ай бұрын
wow, so much better than tkinter. no messing around with multiple frames and using canvas and binding and configuring, etc. I got it to work with Tkinter. Your other video on this is very good btw. I am just doing basic stuff, displaying dataframes as tables in pop out top level windows, etc. But when I wanted to freeze the top row and first column of a table, similar to what you can do in the View tab of MS Excel, things got super complicated. there are just too many moving parts to make real applications in tkinter. so much work for just a scroll bar. it should be way simpler, like in this vid. I will give custom tkinter a go thanks to this nifty video! always super enlightening content. learned a lot about coding from you, thanks!
@TkinterPython
@TkinterPython 3 ай бұрын
Glad you enjoyed it!
@joelale18
@joelale18 9 ай бұрын
can i have a scrollable frame with both orientations?
@SPTutor-l6n
@SPTutor-l6n 15 күн бұрын
Hi, thanks for the video! After assigning different text to each button, I'm having trouble using .get or .cget to retrieve the text from the clicked button in the scrollable frame(so the text can be either printed or used in a function) I have OOP code that can do it but I can't reproduce it with functional programming which is the format I need it in. Any help would be greatly appreciated.
@yuuyaokatani5848
@yuuyaokatani5848 5 ай бұрын
how to destroy or delete scrollable frame? I'm trying to do frame.destroy() but it doesnt work...
@OhNanoh
@OhNanoh 4 ай бұрын
When scrolling the scrollableframe, my buttons are flickering extremely badly. Is there any way i can fix this?
@Golden_Hephaestus
@Golden_Hephaestus 8 ай бұрын
Thank you so much! Is there a function or way to hide/show the scrollbar? It'd be great if I can have the scrollbar show up if only a certain amount of buttons are on screen for example.
@TkinterPython
@TkinterPython 8 ай бұрын
Not that I know of
@lifeislight913
@lifeislight913 10 ай бұрын
Thank you sir❣️
@TkinterPython
@TkinterPython 10 ай бұрын
Welcome!
@amazing_sport
@amazing_sport 6 ай бұрын
I want to scroll frame by mouse wheel. Is it possible? Can you show an example?
@TkinterPython
@TkinterPython 6 ай бұрын
This works with scrollwheel
@MiguelPerez-pt9cl
@MiguelPerez-pt9cl 5 ай бұрын
Hi, I have a problem trying to change the height of the CTkScrollableFrame because it does not change it, I have tried several small sizes, which is what I need, and it does not do it, is there any way to force it to a small size like 100 or 50?
@TkinterPython
@TkinterPython 5 ай бұрын
That widget has a height and width attribute. You can set it to whatever size you want when you define it.
@MiguelPerez-pt9cl
@MiguelPerez-pt9cl 5 ай бұрын
@@TkinterPython Thanks for the quick response my friend, but I think I discovered that the minimum height is 200 because if I use a height lower than that it doesn't take it
@bassycounter
@bassycounter 9 ай бұрын
Hi John! I've been trying to get into learning tkinter and customtkinter so I can create a GUI for a project of mine. I've having trouble finding solutions for creating a layout it which I can have widgets side by side, as opposed to stacked on top of each other (for example, a textbox on one side displaying information relevant to the button clicked on from either a combo box or scrollable frame that's next to it). I'm pretty sure it's something farily simple to implement, however I'm not exactly sure how to go about it. If you could do a tutorial on how to do this, it would be much appreciated!
@TkinterPython
@TkinterPython 9 ай бұрын
Yeah, it's super simple...use .grid() instead of .pack() a google search will show you how to use .grid(column=0, row=1) and .grid(column=0, row=2) etc
@philipanderegg5973
@philipanderegg5973 6 ай бұрын
You have to use the .grid(row=2, column=0) for example. Depending on how you set up your GUI, you can use entity1.grid(row=2, column=0, pady=5) then entity2.grid(row=2, column=1, pady=5) for example, but if you set your GUI up differently where if you put another item in a different column, it looks really weird, due to columnspan configurations, then you can use padding instead and put the entities in the same column but different spot: entity1.grid(row=2, column=0, padx=(0, 200), pady=5) entity2.grid(row=2, column=0, padx=(200, 0), pady=5) Using method 2, you may need to play around with the values in the padx tuple to make it look and be exactly where you want *Note pady=5 isn't necessary but I like to have space between my buttons and things :) Hope this helps!
@Raining_Needles
@Raining_Needles 3 ай бұрын
Hello! When I add widgets into my frame, the frame shrinks to wrap around them, how do I make it so it doesn't do this?
@TkinterPython
@TkinterPython 3 ай бұрын
stackoverflow.com/questions/28089942/difference-between-fill-and-expand-options-for-tkinter-pack-method
@YusifRefae
@YusifRefae 3 ай бұрын
how to change the scroll speed of the CTK scrollable frame? it's very slow. I was able to bind it to key up and down and make the speed 200-300 for better response. But failed using MouseWheel to bind it. Still too slow. Looked through CTK documentation and there's no property for controlling to speed or increment of the scroll bar. any thoughts? Am I the only OCD person who's annoyed by the slow scroll on this frame? hahaha. Thanks!
@TkinterPython
@TkinterPython 3 ай бұрын
It works instantly for me. There may be a problem with your computer settings.
@sachi-gw8lw
@sachi-gw8lw 9 ай бұрын
how can we use scrollable frames in a dropdown menu?
@Krullfath
@Krullfath 6 ай бұрын
I think you need to set the frame master of the dropdown menu to the scrollable one, not sure
@ve70900
@ve70900 8 ай бұрын
Is it possible to have both vertical and horizontal bars?
@philipanderegg5973
@philipanderegg5973 6 ай бұрын
The workaround is to use the .grid and add a vertical Scrollbar using CTkScrollbar, so: my_frame = customtkinter.CTkScrollableFrame(master=root, orientation="horizontal") my_frame.grid(row=1, column=0, pady=10) v_scrollbar = customtkinter.CTkScrollbar(master=root, orientation="vertical", command=my_frame.yview) v_scrollbar.grid(row=1, column=1) my_frame.configure(yscrollcommand=v_scrollbar.set) This seemed to work for me for what I was doing with putting a table into the Scrollable Frame and having it scroll through the table. For me, instead of it scrolling the frame, I had it scroll the table instead.
@MalharPatil
@MalharPatil 4 ай бұрын
@@philipanderegg5973 I tried your method but getting the following error: AttributeError: 'CTkScrollableFrame' object has no attribute 'yview'. Any solutions?
Segmented Buttons - Tkinter CustomTkinter 9
15:46
Tkinter․com
Рет қаралды 7 М.
Understanding parenting and frames in tkinter
11:42
Atlas
Рет қаралды 12 М.
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 206 МЛН
Эффект Карбонаро и нестандартная коробка
01:00
История одного вокалиста
Рет қаралды 10 МЛН
Clowns abuse children#Short #Officer Rabbit #angel
00:51
兔子警官
Рет қаралды 79 МЛН
Use a Drag & Drop Editor to Make Tkinter Python GUI Applications!
11:16
How To Add Scrollbar To The Frame In Tkinter - Python
17:34
CodeWorked
Рет қаралды 49 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 286 М.
Using tkinter with classes
28:23
Atlas
Рет қаралды 57 М.
Tkinter Layout Managers - Simple Crash Course
15:43
NeuralNine
Рет қаралды 7 М.
Understanding scrolling in tkinter
20:56
Atlas
Рет қаралды 12 М.
7 Essential Command Line Tools (2022)
9:12
Tech Craft
Рет қаралды 203 М.
Creating a scrollable widget in tkinter
31:52
Atlas
Рет қаралды 9 М.
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 206 МЛН