from tkinter import * def create_window(): new_window = Tk() #Toplevel() = new window 'on top' of other windows, linked to a 'bottom' window #Tk() = new independent window #old_window.destroy() #close out of old window old_window = Tk() Button(old_window,text="create new window",command=create_window).pack() old_window.mainloop()
thanks for showing us how to make windows. i hav strugled to understand this part due to poor teaching but i only had to watch your vid once to understand
I find this code particularly useful,Thank you Bro for showing so much of everything ,but I do not understand that nearly ten thousand watched it and so few comments?
thanks for the tutorial really helped to understand the basics of opening and closing windows but can you tell me how to make the top window also have a button that says "new window" so that u can infinitly open and close windows?
hye bro, in youtube i never find someone who makes video about save label image as png,jpg and any kind of that.. can u make some video about that on tkinter.. appreciate u bro
Thx a lot brother it helped a lot . But i had a problem can you pls tell like i wanna make a calculator then where do i have to write the code? After the old window main loop or somewhere else?
idk broski but heres a realy bad cauculator if u want it print ("CAUACULATOR") print("ENTER A TOTAL OF 3 NUMBERS AND THEY WILL GET ADDED TOGETHER LIKE MAGIC") num1 = input("number 1: ") num2 = input("number 1: ") num3 = input("number 1: ") answer = (float(num1)) + (float(num3)) + (float(num2)) print(answer)
make a new file, use a def statement and inside that def statement put the cal code. After that import that file and put the def name inside the code, hope this helps
why after creating a new window either with Toplevel() or by Tk() we are not using .mainloop to create window it just directly creates one without .mainloop any reasons.....?
I don't know if you respond to comments, but I'm using pycharm and followed your code exactly but the window isn't popping up. Do you happen to know if I need a specific package to do this?
If anyone else is having this problem I figured it out, make sure that when you go run your code you run the correct section. My issue was that there were two open and I was running main instead of the newly opened one
from tkinter import *
def create_window():
new_window = Tk() #Toplevel() = new window 'on top' of other windows, linked to a 'bottom' window
#Tk() = new independent window
#old_window.destroy() #close out of old window
old_window = Tk()
Button(old_window,text="create new window",command=create_window).pack()
old_window.mainloop()
thanks for showing us how to make windows. i hav strugled to understand this part due to poor teaching but i only had to watch your vid once to understand
but how do i add text to the new menu?
I am glade that this channel exists.
i never like a video, but this is so good information, thanks alot, it feels good to see creators like you teach us. thanks again
Short and very useful video
This was very helpful with little baby beginners like me. Thank you.
that was helpful bro
Great video!
its awsome thank you so so much
U are good
Thanks boss... Exactly what I was looking for
Finally some one who know how to teach a class with out all the other bs, thank you sir!!!
You are great bro.....,🙏
amazingg !!! thank you soo much.
Nice. Thanks
I find this code particularly useful,Thank you Bro for showing so much of everything ,but I do not understand that nearly ten thousand watched it and so few comments?
awesome!
Thank you Bro!
great !! :)
perfect thumbnail doesn't exi-
thanks for the tutorial really helped to understand the basics of opening and closing windows but can you tell me how to make the top window also have a button that says "new window" so that u can infinitly open and close windows?
Thank you
Thank you Bro
Wow!!!
Nice;
Ty bro!
Thanks!
thx dude
This is very helpful.
good vid
nice
ty
amazing 🤩
just wondering how I would be able to edit/add buttons or text to the new window
Great tutorial, good explanation without being too long.
👍
Bro 👏👏👏👏, you're amazing
thanks Mon Wil!
This video is very helpful, thank you. How can I make sure to have only one child window?
Can you make a video on how to close the windows in the def i cant find a way
hye bro, in youtube i never find someone who makes video about save label image as png,jpg and any kind of that.. can u make some video about that on tkinter.. appreciate u bro
Both do the exact same thing for me Tk and top level, I’m trying to creat the same window also not a blank window maybe there is no way I need help
works :D
How to add even more windows
btw thanks for help
How should we code if we want to not allow closing the main window before closing the top window?
Very poggers
IM A BRO NOW LETS GOOO :) love the video
thank you, but how to make text fields
meow meow meow~!
Ok
How do i change the button size
Thx a lot brother it helped a lot .
But i had a problem can you pls tell like i wanna make a calculator then where do i have to write the code?
After the old window main loop or somewhere else?
idk broski but heres a realy bad cauculator if u want it
print ("CAUACULATOR")
print("ENTER A TOTAL OF 3 NUMBERS AND THEY WILL GET ADDED TOGETHER LIKE MAGIC")
num1 = input("number 1: ")
num2 = input("number 1: ")
num3 = input("number 1: ")
answer = (float(num1)) + (float(num3)) + (float(num2))
print(answer)
make a new file, use a def statement and inside that def statement put the cal code. After that import that file and put the def name inside the code, hope this helps
@@someoneontheinternet3427 you forgot to change num2 and num3 inputs from "number 1" to "number 2" etc.
@@MrMeme-jh4ez thx
why after creating a new window either with Toplevel() or by Tk() we are not using .mainloop to create window it just directly creates one without .mainloop any reasons.....?
how do i make my code from below run inside the window???
how do I title my new window?
:)
do you have to download files
Can i find somewhere these commands?
I don't know if you respond to comments, but I'm using pycharm and followed your code exactly but the window isn't popping up. Do you happen to know if I need a specific package to do this?
If anyone else is having this problem I figured it out, make sure that when you go run your code you run the correct section. My issue was that there were two open and I was running main instead of the newly opened one
Is there a way to put ansi inside the window?
how do i use "input" or "print" inside that window habibi
hello bro
How to change the name of the window
offTheChain
How to add multiple buttons to a window that does this same exact thing. Somebody help please
comment
why does my cmd prompt open everytime i press start?
bro i cant insert image on new Tk()
is it possible without importS?
no
how do you change the size of the window
window.configure(width = size, height = size)
But for me, the window doesn't change, after implement the button.
NoGhost thanks a lot
window.geometry("size"x"size")
@@MrMeme-jh4ez thanks
how do w make it repeat itself
i think you can put this under while = example word and set the word to true ?
How do I do this without any modules
you need the tkinter module to do this
19 Videos to go😂😂
You're doing great Game tOut!
@@BroCodez awwww thank you❤
bad bro code
ty
comment