Multiple Windows/Frames in Tkinter GUI with Python - Tkinter tutorial Python 3.4  p. 4

Multiple Windows/Frames in Tkinter GUI with Python - Tkinter tutorial Python 3.4 p. 4

sentdex

9 лет назад

297,931 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@jaydschroeder
@jaydschroeder - 16.06.2023 21:11

An easy improvement is to create the page when it is first used. Implementing the MainWindow.show_frame() as such allows the list of all the pages to be eliminated and just added to as needed:
def show_frame(self, page):
if page in self.frames:
frame = self.frames[page]
else:
frame = page(self.container, self)
self.frames[page] = frame
frame.grid(row=0, column=0, sticky="NSEW")
frame.tkraise()

Ответить
@samuelaniogbu5089
@samuelaniogbu5089 - 16.03.2023 15:07

If I had entry widgets in one or either of the child frames, how do I retrieve the variable in the parent frame?

Ответить
@santinobalestrini8820
@santinobalestrini8820 - 08.02.2023 02:59

hello what if i need to put the "show_frame call" inside a method and not inside the button comment. i cant make it work

Ответить
@jacobthomas1356
@jacobthomas1356 - 25.12.2022 13:18

obviously i'm watching this almost a decade later so you've probably already streamlined this since you made this vid, but feel like i should mention making a parent class for 'Page' that contains all the duplicate code and then just inheriting that template class to PageOne, PageTwo, etc. would be a lot simpler

Ответить
@joseluizdurigon8893
@joseluizdurigon8893 - 17.09.2022 22:24

Thank god you got it done buddy... Thank you so much for this. I wish someday I can be like you and help others like you just did.

Ответить
@user-fo6vn2or5l
@user-fo6vn2or5l - 24.07.2022 16:24

Hi Harrison! thank you so so much for this detailed tutorial
do you have a github directory for this project? so i can see your modules and overall structure? i'm trying to code a program for my lab and this is my first big code project so im totally lost with the design

Ответить
@iamunderthewater5119
@iamunderthewater5119 - 22.05.2022 01:36

For me it says that controller is undefined... Can you help?

Ответить
@ositochann
@ositochann - 12.04.2022 21:11

Everythin's nice and simple, but how can I give static caracteristics for each window like geometry, title, etc?

Ответить
@ositochann
@ositochann - 27.03.2022 03:21

I got this error inside the for F in(PageOne,PageTwo):
self.frames[F]=frame
TypeError: list indices must be integers or slices, not type

Ответить
@vdengineering2666
@vdengineering2666 - 27.12.2021 18:50

Super

Ответить
@maxboje5933
@maxboje5933 - 30.11.2021 23:13

holy shit this is actually so good xD doing a simulation software for university right now and this will help me so much, thank you :)

Ответить
@anthonyyeh162
@anthonyyeh162 - 18.08.2021 18:42

Beginner Pythoner here. Quick question about OOP - why are we creating different pages as separate classes instead of creating a Page class and then instantiating page objects? or am I not thinking about this correctly?

Ответить
@paulmateo4792
@paulmateo4792 - 25.07.2021 07:00

Not sure if you'll see this but how do you set the window size of each individual frame, as my frames are different sizes, and currently they are all as big as the biggest frame.

Ответить
@kunhee9
@kunhee9 - 17.07.2021 18:07

Firstly thank you, I've been trying to learn Tkinter but most of the documentations that were outlined on wiki.python were just outlining its widgets and their code without much on navigating different pages or best practices when using classes. 

Could you share which Tkinter documentation has been the most comprehensive when you were learning, especially when it came to navigating different pages and general best practices.

Ответить
@rohitnegi5566
@rohitnegi5566 - 21.06.2021 15:03

How to put image in frames using your aproch, i tried everything please help

Ответить
@rohitnegi5566
@rohitnegi5566 - 17.06.2021 13:20

how to key bind like this, root.bind("<Return>", func)
i am unable to key bind please help anyone

Ответить
@haywirelive
@haywirelive - 16.05.2021 04:21

This was super helpful, thank you! Just a heads up, I think you should probably add a note to the start of the video that the last two videos in this playlist are needed to understand what's going on here. I found your video by looking up how to make an app with multiple windows and that's really fully explained in this and the last two vids.

Ответить
@_AlfajriAsnanKusuma
@_AlfajriAsnanKusuma - 12.04.2021 23:50

Man, the way your code make me headache

Ответить
@katrinastewart3765
@katrinastewart3765 - 19.03.2021 06:40

this helped me a lot just one thing though , using this code how do i use my own images as buttons instead of a standard button? thanks!

Ответить
@manu92gr
@manu92gr - 23.02.2021 00:56

how can we change the window title here?

Ответить
@Trojan-wd7co
@Trojan-wd7co - 30.11.2020 12:02

How to add background?

Ответить
@anikethkumar1022
@anikethkumar1022 - 17.11.2020 17:55

anyone know how to create an exit button for this code? or link the video where he does?

Ответить
@thomasanderson3790
@thomasanderson3790 - 26.07.2020 21:18

I'm sorry, but why do you have to create a separate class for every page ? i mean why not just write one piece of code that generates pages for you instead?

Ответить
@yurakhrolenko3605
@yurakhrolenko3605 - 11.07.2020 21:07

Thank you!
The idea was awesome!

Ответить
@bevaraindumathi2685
@bevaraindumathi2685 - 14.06.2020 14:04

How to change the size of a frame
"I've used Width and height options , but no change ..." Any help!!

Ответить
@Gazarodd
@Gazarodd - 26.05.2020 00:20

6 years later i know ... but, is there a way to have all those classes in different files ?
I mean, for a "big" project, it won't be "clean" to have ALL the code's lines in one file.. :x

(sry for my english, not native)

Ответить
@kumark3092
@kumark3092 - 12.05.2020 18:14

Your videos are wonderful. I want build a music player in tkinter with pygame. I am stuck on implementation of seek feature on the player. Any ideas please

Ответить
@jflow5601
@jflow5601 - 08.05.2020 00:30

Excellent presentation. You saved me so much time.

Ответить
@charleskentucky6323
@charleskentucky6323 - 27.04.2020 18:43

how do i resize the frame for every page?

Ответить
@natebucher9578
@natebucher9578 - 02.04.2020 05:34

When switching between windows, how do you make it so the window resizes to fit the new class each time?

Ответить
@Aj-hz4dv
@Aj-hz4dv - 22.03.2020 18:00

how do i change color of background ?

Ответить
@mayurpanchal1046
@mayurpanchal1046 - 21.02.2020 06:09

Hi , could you please explain , how to set opened window name for the same program in video.? Thanks in advance

Ответить
@labreynth
@labreynth - 20.01.2020 02:13

Why does it keep saying I'm missing 2 required positional arguments?!

Ответить
@tkinter4428
@tkinter4428 - 14.01.2020 22:09

Thanks a lot.

Ответить
@jacobkunjumon4238
@jacobkunjumon4238 - 05.01.2020 05:58

what if i want to have two frames in one window and i have to fix one frame which has buttons and other frame has to change every time i click a button on first frame.

Ответить
@mr_penchal
@mr_penchal - 04.01.2020 04:26

Sir, is there any possibility without using any button to open one window to another window??

Ответить
@vatsavk1299
@vatsavk1299 - 03.01.2020 09:29

how do you get a string entered in the entry widget in Start Page to a variable in PageOne

Ответить
@munteanionut3993
@munteanionut3993 - 29.12.2019 15:57

Shouldn't the container in the class he defined in the first video be an attribute of the class ?

Ответить
@Jan-bo4bf
@Jan-bo4bf - 26.11.2019 16:23

How do you put a background image when doing it like this?
Also how to set a title when not using variables?

Ответить
@sharada5458
@sharada5458 - 05.11.2019 19:04

Thanks genius for helping me out😊😊

Ответить
@Debiprasadsahudedebi
@Debiprasadsahudedebi - 30.10.2019 09:34

how to set title in this program

Ответить
@jianhong2765
@jianhong2765 - 26.10.2019 20:38

Which is the part of the code that restricts me from using the packing method grid()?

Ответить
@Cat-uk2jx
@Cat-uk2jx - 18.10.2019 04:12

How can i make the screen full size with this method. I tried using the geometry object but I didn't work. I am new at this, so any help will be appreciated.

Ответить
@jannusaelherrerapineda7330
@jannusaelherrerapineda7330 - 15.10.2019 02:33

Question!
How can i put an image background using this method of class definition for each window??????

Ответить
@flamingpheonix5231
@flamingpheonix5231 - 11.10.2019 17:07

sentdex u look so frickin different

Ответить
@stasian11
@stasian11 - 15.09.2019 20:35

Nice guide! Thanks, it helped a lot
But i still have problem. I am trying to build multitab application, where each page is a different graph, for example: page1- temperatures , page 2 -windrose and so on. I wanted to ask you how i can generate different graphs on demand? Thank u in advance

Ответить