Тёмный
No video :(

Multiple Windows With ScreenManager - Python Kivy GUI Tutorial #31 

Codemy.com
Подписаться 233 тыс.
Просмотров 71 тыс.
50% 1

In this video I'll show you how to scroll between multiple windows or screens with ScreenManager for Kivy and Python.
Kivy isn't great at allowing you to create multiple windows. But what it DOES allow you to do is create multiple "screens" inside your main window, and that's what we'll do in this video.
We'll use ScreenManager to manage our different screens, and I'll show you how to scroll between them with the click of a button.

Опубликовано:

 

23 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 145   
@Codemycom
@Codemycom 3 года назад
▶️ Watch Entire Kivy Playlist ✅ Subscribe To My RU-vid Channel: bit.ly/37LrJ27 bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/2Ls0Fvo
@videosincoming6850
@videosincoming6850 3 года назад
oh !! I found the comment... but its not pinned i guess..
@Codemycom
@Codemycom 3 года назад
@@videosincoming6850 Of course it is pinned.
@harshitgupta1367
@harshitgupta1367 3 года назад
Sir got error of kivy.factory.FactoryException : Unknown class
@elvy842
@elvy842 2 года назад
Is this an automatic response because it's not that useful. The particular issue I was facing in my question was not covered on the Kivy course, that's why I asked. I found an answer though: Item1 = self.manager.get_screen('Screen1').ids.item1_id.text Item2 = self.manager.get_screen('Screen2').ids.item2_id.text
@Codemycom
@Codemycom 2 года назад
@@elvy842 What response is that? lol Response to what?
@minihohtis5906
@minihohtis5906 2 года назад
Your explenations are more clear than the Kivy documentation.
@Codemycom
@Codemycom 2 года назад
Ha yeah they're pretty terrible
@DCMPSaliva
@DCMPSaliva 3 года назад
every tutorial shows how to change between screens with buttons - but theres a lack of information on how to call methods from current screen or other screens once you have screens set up. im so confused
@pashabuddha
@pashabuddha 3 года назад
The same, bro
@wat3rfall735
@wat3rfall735 3 года назад
you can use the root.manager.get_screen('screen_name').widget_id.parameter (like root.manager.get_screen('main_window').label.text) inside your .kv file
@CoderBB
@CoderBB 3 года назад
Sir don't forget to create a playlist on Android development using kivy.... I am eagerly waiting for this... And thanks for this awesome playlist on kivy 🙌
@altaaf_taafuuu08
@altaaf_taafuuu08 2 года назад
Hi, peace be upon you. The same is for android, you just need to have Python on android. All this will work on android
@tuhinbhowmick8424
@tuhinbhowmick8424 3 года назад
I was waiting since 9:00 pm (IST) to watch your video
@Codemycom
@Codemycom 3 года назад
Cool
@akatproje3448
@akatproje3448 2 года назад
Thank you very much, there is so little conversations and Educations like yours beautiful videos...
@elitecoder9246
@elitecoder9246 3 года назад
Either You Answer Or Not YOU ARE AWESOME MAN!!!!! Please Pray For My Next Generation That They May Get Me As Their Super Powered Father As You.
@Codemycom
@Codemycom 3 года назад
:-)
@elitecoder9246
@elitecoder9246 3 года назад
@@Codemycom Mail Please! I Want To Talk With You. Please Don't Make Me Hopeless.
@Codemycom
@Codemycom 3 года назад
@@elitecoder9246 You're talking to me right here.
@elitecoder9246
@elitecoder9246 3 года назад
@@Codemycom ok my ♥ly tutor
@user-jt6uu1ru7s
@user-jt6uu1ru7s 3 года назад
Thank you very much for all the videos that explained kivy 🌹🌹
@Codemycom
@Codemycom 3 года назад
You are so welcome!
@samrierena1723
@samrierena1723 3 года назад
guys please help i can't access my kivymd variable it says " 'super' object has no attribute '__getattr__' "...please help as soon as possible
@infinitespace1982
@infinitespace1982 3 года назад
For those of you who run into the problem where you can't choose the direction of the transition, the Kivy 2.0.0 documentation states using 'root.manager.transition.direction = 'left/ right' instead, which worked for me.
@davidakavegasrepoman
@davidakavegasrepoman 2 года назад
I have a error that says: object has no attribute 'manager'
@santoshgujar5237
@santoshgujar5237 2 года назад
Thank you, Sir, you are Best Teacher
@Codemycom
@Codemycom 2 года назад
Thanks!
@Tawkir_Choudhury
@Tawkir_Choudhury 2 года назад
This is very useful for me. Thank you very very much ❤️
@Codemycom
@Codemycom 2 года назад
Welcome!
@samadnarayan7262
@samadnarayan7262 2 года назад
Thanks for this awesome video, John. I wanted to ask that what is the difference between, on_release and on_press. Thanks, Samad Narayan
@Codemycom
@Codemycom 2 года назад
Just what they say...one happens when you press the button, the other when you release the button
@rreemmccoo1
@rreemmccoo1 2 года назад
i tryed to update a list and display the same list. When i only used On_press it only showed the old list, second press was the updated list. When i changed it to On_press "update list" and On_release " Show list" it worked
@whitebird365
@whitebird365 3 года назад
Nice! Please how can we send some data from one screen to another?
@wat3rfall735
@wat3rfall735 3 года назад
you can use the root.manager.get_screen('screen_name').widget_id.parameter (like root.manager.get_screen('main_window').label.text) inside your .kv file
@chriver
@chriver 3 года назад
Thnx! Your video's are very helpful to me!
@Codemycom
@Codemycom 3 года назад
Glad to hear that!
@eddw123
@eddw123 2 года назад
Still useful to me😁👍just this functionality looks more like “scrolling pages ,one window”, Do you think that something like this can be implemented in one of the AccordionItem tabs?
@superarno121
@superarno121 3 года назад
Why do you have to specify 'app' in app.root.current but not in root.manager.transition.direction?
@justanorthernlight
@justanorthernlight 3 года назад
If you're using a screen manager nested inside a different layout (tabbed, for example), how do you call the next screen? app.root.current doesn't work for me. A tutorial on how to store a variable with one button and then access it elsewhere in the app would also be nice.
@wat3rfall735
@wat3rfall735 3 года назад
i guess you can use the root.manager.get_screen('screen_name').widget_id.parameter (like root.manager.get_screen('main_window').label.text) inside your .kv file
@brunofonseca8798
@brunofonseca8798 2 года назад
Hi, great video! It is possible to use screen manager for add new screens in a popup?
@elvy842
@elvy842 2 года назад
Hi John, great introductory material. Say I have screen1, screen2 and screen3, which are all stored in different modules, and I want to display the values from screen1 & screen2 in screen3, how do I go about achieving this?
@crypto1886
@crypto1886 2 года назад
i belive you need to use the #:import x.y.z command in kivy but i dont know how to use it as it is quite complicated
@sweeterdeeker9436
@sweeterdeeker9436 2 года назад
possibly save as JSON file and retrieve...? this is something I am dealing with also. I am trying to figure out how to use python code to create a window that is not relative, but boxlayout or stacklayout or scrollview...
@elvy842
@elvy842 2 года назад
@@sweeterdeeker9436 The following worked for me, I suppose this is me answering my own question lol: Item1 = self.manager.get_screen('Screen1').ids.item1_id.text Item2 = self.manager.get_screen('Screen2').ids.item2_id.text I hope this is useful to you too Regards Elvy
@bigsun4022
@bigsun4022 2 года назад
Hello, do you think Python w kivy is good for desktop apps development or There is a better Lang?
@junkpow
@junkpow 3 года назад
kivy.factory.FactoryException: Unknown class How to Fix???
@rreemmccoo1
@rreemmccoo1 2 года назад
This is what i used in my .py def build(self): sm = ScreenManager() sm.add_widget(MainWindow(name="main")) sm.add_widget(SecondWindow(name="game")) return sm i didn't use the class WindowManager(ScreenManager) also in the .kv file i removed the Manager setup
@NoTakeOnlyThrow
@NoTakeOnlyThrow 3 года назад
if you were to have multiple buttons within screens that lead to other screens would you indent them under the window manager?? or do you just list them all out unindented? i.e. WindowManager: First: a: b: Second: a: b:
@ice-luxcondicionadoresdear8357
@ice-luxcondicionadoresdear8357 11 месяцев назад
ola estou criando um app com kivy porem nao encontro em lugar algum como fazer reconhecer piscada de olho atraves da camera com kivy, vc saberia me ajudar
@m.nikolatesla
@m.nikolatesla 3 года назад
Thank you bro. I like your videos.
@Codemycom
@Codemycom 3 года назад
Thanks!
@rreemmccoo1
@rreemmccoo1 2 года назад
maybe i just need to learn a bit more but where do you def your functions? I created my mainpage without screenmanager and it worked. now i trying to ge a second page and ik get AttributeError: 'ScreenManager' object has no attribute 'submit'
@MyMaxcy
@MyMaxcy 2 года назад
How can I add and call the widget ID inside the child screens?
@AlterLZT
@AlterLZT 2 года назад
Find a way?
@kevincranfield2471
@kevincranfield2471 2 года назад
Hi trying to follow this tutorial where I am confused is if I have code already in my layout(widget) class ( a button press in my kv file), where does the press function go once I remove the original layout class.. (hope this makes sense) thank you
@codewarrior4458
@codewarrior4458 2 года назад
Just Subscribed 😁😁
@Codemycom
@Codemycom 2 года назад
thanks!
@sweeterdeeker9436
@sweeterdeeker9436 2 года назад
Do you have an extensive python code for creating kivy with multiple screens? something with buttons, etc from a list?
@glendydesabille3977
@glendydesabille3977 3 года назад
Thank u for this, ive really learn a lot in ur channel, may u make also using animation in kivy or transistion?
@Codemycom
@Codemycom 3 года назад
animation for what?
@glendydesabille3977
@glendydesabille3977 3 года назад
Animation on pictures
@glendydesabille3977
@glendydesabille3977 3 года назад
@@Codemycom thank u for the reply also ☺️
@paulushimawan5196
@paulushimawan5196 Год назад
Animation like in PowerPoint slides? I don't think we can do that here
@Alikhan-xm1xq
@Alikhan-xm1xq Год назад
Thank you very much!!!!
@Codemycom
@Codemycom Год назад
Welcome!
@akshaygangwani9875
@akshaygangwani9875 2 года назад
hi what if an app requires more than 10 pages and each having many lines of code, Like if i want to create an ecommerce app? I am able to create basic small apps but if i try to create bigger apps my codes gets dirty!
@hosniali9651
@hosniali9651 2 года назад
Hello ,how can I disable the minimize , maximize and close buttons in the kivy application
@crishl19
@crishl19 2 года назад
but if am working in app where I have my app how to I do screens ?
@Leo-go4nf
@Leo-go4nf 8 месяцев назад
Does anyone know a way to make the screens just appear instead of scrolling into place?
@vibhar7999
@vibhar7999 2 года назад
How to create .kv file ?? Which version of pycharm you are using ? Because I use community versions...........
@Codemycom
@Codemycom 2 года назад
I don't use or recommend pycharm.
@vibhar7999
@vibhar7999 2 года назад
👍
@vibhar7999
@vibhar7999 2 года назад
Is there any way we can do it in pycharm ....... If yes then please let me know
@Codemycom
@Codemycom 2 года назад
@@vibhar7999 I don't use or recommend pycharm.
@CodeWithJoe
@CodeWithJoe 3 года назад
how can i make this with swiping on a phone?
@ramitpanangat7855
@ramitpanangat7855 3 года назад
How to use id of a widget in one screen in second screen? eg. One screen has a Text Field and when write your name in that and enter submit, it should go to next screen where it shows your name write in text area.
@wat3rfall735
@wat3rfall735 3 года назад
you can use the root.manager.get_screen('screen_name').widget_id.parameter (like root.manager.get_screen('main_window').label.text) inside your .kv file
@kendjinone830
@kendjinone830 2 месяца назад
this only loads the kv code of the interface and not the .py that are linked to each interface
@bigsun4022
@bigsun4022 2 года назад
Thanks. helped a lot
@Codemycom
@Codemycom 2 года назад
Glad it helped
@learnnow9598
@learnnow9598 3 года назад
Love and love only💙. Bro can you make a small video for packaging kivy for android in Linux?
@Codemycom
@Codemycom 3 года назад
Eventually I'll get to that.
@abdallahalmiski3988
@abdallahalmiski3988 3 года назад
how can I return 2 thing in my app like my widget and my builder
@Tawkitoutti
@Tawkitoutti 3 года назад
when do you do root.size vs root.width, root.height?
@advays9815
@advays9815 3 года назад
Can we do this multiple window thing with kivymd?
@schlechtestergtaspielerdek3851
I already had two Widgets, used as screens, doing what they should be doing. Now I used screen manager and transitions to be able to swap through them without changing my code XD. However, I have a slider in one Widget/Screen. Since I used the screen manager, this slider always shows the value I set it to AND the value 0. It has 2 pointers al of the time. I am also using 2 Buttons to increase or decrease a value, shown on the screen as a label. Since the Screenmanager, this label always shows the current value AND the value it had, when the program was started, so the default value. Both ontop of each other. If I change the screen back to a Widget, both slider and the "label value" function as they should. I googled a lot but cant find a solution. Can someone help me? :)
@alexbggtt
@alexbggtt Год назад
Can someone help me? I copied to code exactly, but I get an error that says there’s no file “new_window.kv”
@Codemycom
@Codemycom Год назад
sounds like you have no file named new_window.kv
@navirobayo
@navirobayo Год назад
Amazing
@Hamheadon
@Hamheadon 2 года назад
How does one set it to give no transitions at all
@rajaryan7167
@rajaryan7167 3 года назад
namaste sir from india
@Codemycom
@Codemycom 3 года назад
hello!
@abdallahalmiski3988
@abdallahalmiski3988 3 года назад
how am I suppose to make my text black with no canvas
@alexwoodhead6471
@alexwoodhead6471 2 года назад
just throw's errors with kv = Builder.load_file('new_window.kv")" ...
@gpowerturbo7887
@gpowerturbo7887 2 года назад
how i can modify time of transition from screen to other screen
@mariamkhanam4037
@mariamkhanam4037 2 года назад
How can I hide presplash screen in kivy??
@PieAzalea
@PieAzalea Год назад
Guys, here to share my struggles and the solutions in case someone faces the same situation. I've been writing the exact same code but the output was a BLANK BLACK screen. I found out later I had to use " ScreenManager().addwidget(..screen class name..) " and then " return ScreenManager() " in build(self) attribute instead of "return kv". Still wondering why can't I write as simple as the code in this video though.
@mayangan_empire
@mayangan_empire 2 года назад
Thanks
@Codemycom
@Codemycom 2 года назад
Welcome!
@borisbob
@borisbob 2 года назад
Best u are
@Codemycom
@Codemycom 2 года назад
Thanks
@atheeb845
@atheeb845 2 года назад
Please post a video to switch screens with python code.
@haddad__abdelaziz320
@haddad__abdelaziz320 2 года назад
Think you How to add mddatatable to screen manager
@user-ru1qt2og1o
@user-ru1qt2og1o Год назад
0:00 Yo sup! :D
@hiwab41
@hiwab41 3 года назад
Awesome!
@Codemycom
@Codemycom 3 года назад
Thanks!
@1214loko
@1214loko 2 года назад
Someone knows if it's impossible to use MDButtons or other MD component inside a screen, is it possible to use just Button: ?
@Codemycom
@Codemycom 2 года назад
Of course, you can use any kind of button you want
@manojsudarshana4377
@manojsudarshana4377 2 года назад
Hi there. Consistently getting Unknown class error. Please help
@Codemycom
@Codemycom 2 года назад
What did you do differently from the video?
@Angelina-hj4rh
@Angelina-hj4rh 4 месяца назад
I might be too late but for those who are looking for the same problem: You have to define your classes (Pythonfile) BEFORE you reference your kv file via Builder. (Sry english is not my 1st language, hope you did understand)
@joshuaabbott5026
@joshuaabbott5026 2 года назад
Does anyone know how to set the current screen from within a on_press event, in the .py file? I need to check some conditions before allowing the user to go to the next screen, so I need to route from the .py and not the .kv
@sweeterdeeker9436
@sweeterdeeker9436 2 года назад
I am also looking for PY file commands on how to make multiple screens, pass data between those screens, JSON FILE?!?!, and how to make the screen be a boxlayout, or stacklayout and use a for loop to create a button, that is dynamic based on a list, etc.
@borneoviral6379
@borneoviral6379 3 года назад
Hey Bro... how do you skip the slide animation. I mean it still change from screen 1 to screen 2 by pressing the button.. but how to do it without the slide animation. Is theres a way to do that
@Codemycom
@Codemycom 3 года назад
sorry, not sure what you mean
@blakedexter1301
@blakedexter1301 3 года назад
To skip the sliding animation do this: Step1: First, import this in your kv file: #: import SlideTransition kivy.uix.screenmanager.SlideTransition Step2: Then add this line as the first line under the on_release event: app.root.transition = SlideTransition(duration = 0) Example: Button: text : 'Next Screen' font_size: 36 on_release: app.root.transition = SlideTransition(duration = 0) app.root.current = 'second' Do this for both windows Also if you want to change the slide animation speed, use different values for duration instead of 0.
@kumaramit76
@kumaramit76 3 года назад
Hey it doesnt work for me it says unknow class name
@abhaybairagi8300
@abhaybairagi8300 2 года назад
its appearing black window when using screen maneger in kivy
@Codemycom
@Codemycom 2 года назад
weird
@theh0lybrick
@theh0lybrick 3 года назад
can we do this by creating boxlayout in carousel
@Codemycom
@Codemycom 3 года назад
try it and see
@weluvprogramming
@weluvprogramming Год назад
when are we getting the pop-up window
@Codemycom
@Codemycom Год назад
What do you mean?
@viji8126
@viji8126 2 года назад
sir can you put a video on how to make the same in python tkinter ?
@Codemycom
@Codemycom 2 года назад
Hi, you would just use frames with tkinter.
@AliFGT
@AliFGT 3 года назад
can i make like this in tkinter without pack forget hack?
@Codemycom
@Codemycom 3 года назад
kivy is nothing like tkinter
@wardahambreen2493
@wardahambreen2493 3 года назад
sir please tell how to add functionality of passport size image for user in tkinter form
@Codemycom
@Codemycom 3 года назад
Sorry I don't know what passport size image is and this is not a tkinter playlist..my tkinter playlist has lots of videos on images and resizing images etc.
@wardahambreen2493
@wardahambreen2493 3 года назад
I am talking about the image of the scholarship form Which is on the top of the form where users upload there pic
@wardahambreen2493
@wardahambreen2493 3 года назад
_______________ ! ! ! UPLOAD. ! SCHOLARSHIP ! IMAGE. ! FORM ! ! _______________ NAME = AGE = CNIC NO. = ADDRESS= MOBILE NO. = etc Just like this
@Codemycom
@Codemycom 3 года назад
the scholarship form? lol I have no idea what you're talking about, but I have lots of videos on images on the playlist.
@wardahambreen2493
@wardahambreen2493 3 года назад
@@Codemycom ok
@videosincoming6850
@videosincoming6850 3 года назад
this code is not in ur github repo ??
@Codemycom
@Codemycom 3 года назад
of course it is
@videosincoming6850
@videosincoming6850 3 года назад
@@Codemycom ​ but there no link in the comments section or description...
@Codemycom
@Codemycom 3 года назад
@@videosincoming6850 Yes there is, the first pinned comment.
@marciopataka6843
@marciopataka6843 Год назад
Hi
@Codemycom
@Codemycom Год назад
hi
@kumaramit76
@kumaramit76 3 года назад
Not working
@Codemycom
@Codemycom 3 года назад
Then you did something wrong
@kumaramit76
@kumaramit76 3 года назад
@@Codemycom Yes i realized what i did wrong oops :P
Далее
Spinner Dropdowns - Python Kivy GUI Tutorial #32
7:13
#JasonStatham being iconic
00:38
Просмотров 357 тыс.
Screen navigation in Kivy - ScreenManager()
24:00
Просмотров 9 тыс.
Modern Python logging
21:32
Просмотров 178 тыс.
Tmux has forever changed the way I write code.
13:30
Просмотров 967 тыс.
I've been using Redis wrong this whole time...
20:53
Просмотров 353 тыс.
Using AI to Create the Perfect Keyboard
12:05
Просмотров 1,4 млн
Python GUI Development With PySimpleGUI
15:15
Просмотров 1 млн
How Hackers Write Malware & Evade Antivirus (Nim)
24:04