Create tabs in your GUI interface using Notebook - Python Tkinter GUI Tutorial #64

  Рет қаралды 69,904

Codemy.com

Codemy.com

Күн бұрын

Пікірлер: 128
@Codemycom
@Codemycom 4 жыл бұрын
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My KZbin Channel: bit.ly/2UFLKgj 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
@rahibmansurov9491
@rahibmansurov9491 3 жыл бұрын
This channel the best cannel in youtube about Pyhton programming !!!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks so much!
@alejondelacruz5096
@alejondelacruz5096 3 жыл бұрын
I love this vids, please keep doing them, I'm poor and can't afford to pay for online courses so youtube is my only hands on teacher. Please keep them up.
@Codemycom
@Codemycom 3 жыл бұрын
There's over 160 of them so far with no plans to stop
@Pascal-hw6qo
@Pascal-hw6qo 2 жыл бұрын
Correction, you are very rich - Getting so much education for free :)
@Sailesh_Bhoite
@Sailesh_Bhoite 4 ай бұрын
​@@Pascal-hw6qo, Nice!
@4_shore
@4_shore 4 жыл бұрын
I am loving these tkinter tutorials. THANK YOU!
@Codemycom
@Codemycom 4 жыл бұрын
I'm so glad!
@arsalanwasim4177
@arsalanwasim4177 4 жыл бұрын
Thanks a lot, this is perfect for my machine learning GUI, hats off to you brother.
@Codemycom
@Codemycom 4 жыл бұрын
Glad it could help you
@kapibara2440
@kapibara2440 7 ай бұрын
Super! You just gave me an idea how to combine my two tkinter apps into one. They are almost identical in layout, differing only in the source document, which the user needs to provide. Thank you John :)
@Codemycom
@Codemycom 7 ай бұрын
Happy to hear it!
@creativecore3575
@creativecore3575 3 жыл бұрын
You're the man. this video is CLUTCH
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@levilewis9831
@levilewis9831 4 жыл бұрын
Nice little quick guide on notebook module, thanks man keep it up :)
@Codemycom
@Codemycom 4 жыл бұрын
Glad you liked it!
@talalal-dobai7348
@talalal-dobai7348 4 жыл бұрын
how are you Mr.john. i have made same as you did in this lesson, but whatever i add to the second frame (labels, buttons, .etc...), the frame size getting smaller, and if add things (labels, buttons...) just to the first frame the size keep as planned. Thank you for your great easy understandable explanation...
@ahmetpehlivan5494
@ahmetpehlivan5494 2 жыл бұрын
did you find solution?
@shouryashantanu9864
@shouryashantanu9864 4 жыл бұрын
Please tell how to set tab vertically
@ahamedashfaaq8781
@ahamedashfaaq8781 4 жыл бұрын
Noting to say. Superb 😃
@Codemycom
@Codemycom 4 жыл бұрын
Thank you so much 😀
@ahamedashfaaq8781
@ahamedashfaaq8781 4 жыл бұрын
All the best keep it up 😄
@sohankyatham179
@sohankyatham179 4 жыл бұрын
Great Video!!! (Not a surprise...all your videos are great) Could you also teach us how to open a file in a tab (notebook widget), and then be able to close that tab?
@OddvinAlmenning
@OddvinAlmenning 4 жыл бұрын
Super! I need this. Thanks for the good and explanatory video.
@Codemycom
@Codemycom 4 жыл бұрын
Glad you liked it!
@Gustavooliveira-zl7ru
@Gustavooliveira-zl7ru 4 жыл бұрын
the power of the internet. in Brazil watching your videos what a pity that there is no option to translate simultaneously, to follow more easily and understand all content
@Codemycom
@Codemycom 4 жыл бұрын
Maybe someday!
@michaelmichael9809
@michaelmichael9809 3 жыл бұрын
Thank you for great course! Question - if i trying to use in "notebook.add()" frame, created by class (passing "notebook" as target) i get - "_tkinter.TclError: bad window path name "". What is a way to use in notebook class-created frames ( with all stuff inside)? Thank you!
@moespoon2351
@moespoon2351 4 жыл бұрын
how can i change the size of those tab buttons , or make them fill the whole thing to the right ?
@motu1534
@motu1534 4 жыл бұрын
How can I change the size of text written in tab selection buttons?
@naokimc
@naokimc 3 жыл бұрын
Awesome, but how can we increase the fontsize of the tab's text?pls help me!
@TakeAMessage33
@TakeAMessage33 Жыл бұрын
john, great videos, I've seen many. any chance you could help with something that seems that it should be simple but banging my head on... creating buttons at top of window then tab frame below. i've got that working using grid but, my tab frame will not fill the bottom area. tried pack and grid but no luck. thanks.
@nicolasb3362
@nicolasb3362 4 жыл бұрын
Hi Codemy, Thanks for the videos. What's the proper way of using Notebook and grid at the same time (Do I want to do that, or is there a better way?). It seems that it is easy to create conflicts with the pack geometry, which is hard to use in more complex GUI. Many thanks! Nicolas
@myrealname6881
@myrealname6881 4 жыл бұрын
Hi just a question about notebook is there a way to completely hide the top 'tab' bar and just go to different tabs using buttons?
@Codemycom
@Codemycom 4 жыл бұрын
Maybe using bindings
@yogenghodke
@yogenghodke 3 жыл бұрын
Beautiful !
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@aminahankobi9154
@aminahankobi9154 Жыл бұрын
It was very nice. I wish U the best✌
@Codemycom
@Codemycom Жыл бұрын
thanks!
@brahimmellal3227
@brahimmellal3227 3 жыл бұрын
thumbs up even befor watching the video
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@RyanDanielG
@RyanDanielG 3 жыл бұрын
feed the algorithm! great vid
@HanZhang1994
@HanZhang1994 4 жыл бұрын
Is there a way to select tab for showing and hiding by it's display text, so that old code doesn't break when I add in new tabs?
@maxwellhawk
@maxwellhawk 2 жыл бұрын
Question: 1. How can I regulate size, bg fg color and font/size of the tabs itself? 2. Can I automatically scale size of tabs equally on full length on X axis?
@Ibrahim_talib
@Ibrahim_talib 2 жыл бұрын
Hello every one Is it possible to put multiple fames in one tab? like putting two frames in tab1.
@Codemycom
@Codemycom 2 жыл бұрын
Of course.
@cursedpoptart
@cursedpoptart 3 жыл бұрын
Trying to add this to my guess the number and it's opening another window... How would I add it to the same window so they can just click on the tabs?
@aradabasi6308
@aradabasi6308 3 жыл бұрын
Very good 👍
@arunteja740
@arunteja740 4 жыл бұрын
Can you please make a video on how we can make Tkinter window more responsive and how to setup great looking UI like desktop applications such as Norton,VLC etc
@Codemycom
@Codemycom 4 жыл бұрын
Sure, Eventually I'll get to that :-)
@matthewneal4881
@matthewneal4881 2 жыл бұрын
Man I am trying to create a program and any time I am trying to figure out how to do something you have a video about it. Thank you very much
@Codemycom
@Codemycom 2 жыл бұрын
Ha, awesome!
@vpxnyy69
@vpxnyy69 3 жыл бұрын
Is there a way to change the color of the tabs?
@EFoxVN
@EFoxVN 2 жыл бұрын
I wonder whether one could basically almost immitate a ribbon with this notebook widget, such as those you get in MS Word.
@michelnaouss748
@michelnaouss748 4 жыл бұрын
How can i include fill and expand in .grid() instead of .pack() . Great course btw it helped me a lot!
@adrianojose7172
@adrianojose7172 4 жыл бұрын
Thanks for these amazing videos!! I was wondering if there was an option to padx the tabs , cause they kinda seem all crammed up. Also if i could change the colour of the tab or the space behind the tab. Thank you! :D
@jatingera924
@jatingera924 3 жыл бұрын
didi you find any, as i would look for it from now. any suggestion?
@Pascal-hw6qo
@Pascal-hw6qo 2 жыл бұрын
Thank you for the tutorial. The code for the content of every tab is now nested in one file. If every tab has 1.000 lines and I have 5 tabs the file would have 5.000 lines. That is not very easy for maintaining the code. How can I make a file for every tab and have a main file for creating the tabs and let it work together? I hope my question is understandable.
@aaroncatolico7550
@aaroncatolico7550 2 жыл бұрын
I'm used to using Visual Basic in Visual Studio where you can create as many tabs as you'd like, and once the tabs fill up across the width of the application, then two arrow tabs appear automatically to go further over (forwards) so that you don't need to make your application window wider. The two arrows that I'm referring to are like backwards or forwards that appear automatically when there are too many tabs on your form/window which prevents you from having to make your form/window wider. So, does Tkinter offer such a solution? If so, how do we implement it? Thanks.
@Codemycom
@Codemycom 2 жыл бұрын
Not that I know of.
@ptinting4everyone739
@ptinting4everyone739 3 жыл бұрын
thanks for The Hard work, es it Possible to doubble click on the Tab and the Content will be open in new Window or Just Hold the Klicked Mouse an take the tab from the Notebook and the content it will be open in new Window, i hope you get what i mean, im not good explainer ;)
@Codemycom
@Codemycom 3 жыл бұрын
You could maybe hack something together with bindings
@mariamkhanam4037
@mariamkhanam4037 3 жыл бұрын
Bro, How can I create sub tabs/nested tabs??
@rijabiba8792
@rijabiba8792 4 жыл бұрын
How can you add a 'x' (close) button at the right side of the tab? I saw some codes online but it is to complicated to understand. Thanks
@Codemycom
@Codemycom 4 жыл бұрын
No idea...but why would you want to?
@rijabiba8792
@rijabiba8792 4 жыл бұрын
@@Codemycom I just want to expirement, add something, etc. but anyway thank you for this great tutorials
@slobodantajisic2762
@slobodantajisic2762 4 жыл бұрын
@@rijabiba8792 There is no easy way to explain that. I think it is about ttk themed widgets. Unfortunately, we should try to learn that. :-) One simple example : from tkinter import * from tkinter import ttk root = Tk() root.title("Learn To Code") root.geometry("500x500") style = ttk.Style() style.configure(".", font="Arial 14", foreground="green", background="yellow") # Default style is with dot btn_default = ttk.Button(root, text="Default Style") style.configure("new_style.TButton", font="Helvetica 14", foreground="blue", background="white") # Custom style btn_new_style = ttk.Button(root, text="New Style", style="new_style.TButton") btn_default.pack(pady=15) btn_new_style.pack() root.mainloop() Now we just need to learn how to achieve the desired look of our tab and its functionality :-)
@jankipatel2392
@jankipatel2392 4 жыл бұрын
@@slobodantajisic2762 from where are you learning gui apart of this chennal
@jatingera924
@jatingera924 3 жыл бұрын
@@slobodantajisic2762 from where did u learn this? pls tell ...
@marcosmiraco
@marcosmiraco 3 жыл бұрын
Is there a way to change the background color of a tab?
@Codemycom
@Codemycom 3 жыл бұрын
not that I know of
@marcosmiraco
@marcosmiraco 3 жыл бұрын
@@Codemycom After a lot of research I discovered that it is possible to change using this: www.tcl.tk/man/tcl8.6/TkCmd/ttk_style.htm, you have to create a new style or modify an existing style. With that said, I found the topic quite interesting and since you are a master at using Tkinter I would like it very much if you could do more research on the subject and make a video on how to make your own styles and all that. It may be asking a lot, but I really like your videos and I would love to see a video explaining about it.
@Codemycom
@Codemycom 3 жыл бұрын
@@marcosmiraco yeah I've talked about style in a few videos but have been meaning to go into it in more depth
@sanskargr9347
@sanskargr9347 3 жыл бұрын
can you show me to how to do new tad in notebook
@thermite10k40
@thermite10k40 3 жыл бұрын
I decided to add a 4th button which is in the second frame and it does work but the size of the frame becomes much smaller, my_button4 = Button(my_frame2, text="Navigate to tab 1", command=select_first) my_button4.pack(pady=15, padx=(1,15)) this is the 4th button and the command is: def select_first(): my_noteBook.select(0) and the frame is defined the same as you did, any thoughts? Thanks for the videos!
@jsivesh4323
@jsivesh4323 Жыл бұрын
Same problem
@iamdanishshahid
@iamdanishshahid 4 жыл бұрын
Hello! I made a GUI using 2 tabs just like in your video. Tab1 was for the basic version of the GUI and Tab2 for an advanced version. The advanced version of my GUI was basically the basic version plus a few extra features. So a part of Tab2 included code of Tab1. Now the issue is when I run Tab1 and Tab2 separately, the calculation on my GUI works fine for both. But when I run them together in one GUI with 2 tabs, calculations for Tab2 work but Tab1 doesn't. Is this because some of my code is repeating in tabs? Any suggestion what I should do? Also, Your videos are great. Very helpful and to the point.
@Codemycom
@Codemycom 4 жыл бұрын
Sorry, I'm not sure what's going on since I haven't seen your code.
@LevelUpGA
@LevelUpGA 4 жыл бұрын
try parallel processing
@DuarteBombas
@DuarteBombas Жыл бұрын
Hi, great video! So I started using tabs in my code and realized that something that happened to me turned out to be a quite common "error" which is when using more than two tabs, after putting content on the third one, the size of the frames automatically changes even though they are all expanded. I've tried playing around with sizing and padding but with no actual result. Do you know what this could be about or how to solve it? Thank you so much for all the help your videos give!!
@Codemycom
@Codemycom Жыл бұрын
Sorry, I'm not familiar with that
@paridhidixit3402
@paridhidixit3402 4 жыл бұрын
how to hide all open tabs?
@nadie7480
@nadie7480 3 жыл бұрын
Does anybody know how can I add an .ico image inside the tab name?
@mariamkhanam4037
@mariamkhanam4037 3 жыл бұрын
What Does the ttk.NoteBook() Doo??
@Codemycom
@Codemycom 3 жыл бұрын
What the video shows you it does...
@jankipatel2392
@jankipatel2392 4 жыл бұрын
Sir I make same tabs as you made. But apart of this I made one more button of "hide frame 0" in fram 2 but the width and height of the frame changes... What the issue sir please tell??
@Codemycom
@Codemycom 4 жыл бұрын
are you not expanding the frame?
@vanshatcode
@vanshatcode 4 жыл бұрын
Thanks,
@Codemycom
@Codemycom 4 жыл бұрын
Welcome
@softinfo2541
@softinfo2541 4 жыл бұрын
You are just amazing SIR, I am facing a typical issue and unable to sort it out. instead of 2 I made 3 tabs and added some buttons in each, but when I add anything (label or button) in 3rd tab the output display size changes. these are my codes below please help me to figure it out please: main=Tk() main.title("Digital Sales Tool Kit") main.geometry("600x600") toolkit=ttk.Notebook(main) toolkit.pack() deviceframe=Frame(toolkit, width=600, height=600, bg="white") postpaidframe=Frame(toolkit, width=600, height=600, bg="white") elifeframe=Frame(toolkit, width=600, height=600, bg="white") deviceframe.pack(fill="both", expand=1) postpaidframe.pack(fill="both", expand=1) elifeframe.pack(fill="both", expand=1) toolkit.add(deviceframe, text="Devices") toolkit.add(postpaidframe, text="Postpaids") toolkit.add(elifeframe, text="Elife Plans") #SMARTPHONES apple=Button(deviceframe, text="APPLE", padx=16, font=("times new roman", 12)).grid(row=2, column=0) samsung=Button(deviceframe, text="SAMSUNG", font=("times new roman", 12)).grid(row=3, column=0, pady=5) huawei=Button(deviceframe,text="HUAWEI", padx=9, font=("times new roman", 12)).grid(row=4, column=0) xiaomi=Button(deviceframe, text="XIAOMI", padx=11, font=("times new roman", 12)).grid(row=5, column=0, pady=5) nokia=Button(deviceframe, text="NOKIA", padx=14, font=("times new roman", 12)).grid(row=6, column=0) #POSTPAID PLANS freedom=Button(postpaidframe,text="Freedom", padx=32, font=("times new roman", 12)).grid(row=2, column=1) freedomunlimited=Button(postpaidframe,text="Freedom Unlimited", font=("times new roman", 12)).grid(row=3, column=1) newpostpaid=Button(postpaidframe,text="New Postpaid", padx=16, font=("times new roman", 12)).grid(row=4, column=1) emarati=Button(postpaidframe,text="Emarati", padx=36, font=("times new roman", 12)).grid(row=5, column=1) smart=Button(postpaidframe,text="Smart", padx=40, font=("times new roman", 12)).grid(row=6, column=1) #this is what i want to post in the 3rd tab elifeunlimt=Button(elifeframe,text="Elife Unlimit", padx=2, font=("times new roman", 12)).grid(row=2, column=2) main.mainloop()
@Codemycom
@Codemycom 4 жыл бұрын
There's probably an error in your code but I don't have the time to go thru it all. Work it through yourself, you'll find the error eventually.
@DuarteBombas
@DuarteBombas Жыл бұрын
Did you find a solution for this problem??
@connorkelly5791
@connorkelly5791 4 жыл бұрын
Great video! I'm trying to create a notebook-type UI where each tab has different Label, Entry and Button widgets. Is it possible to use the grid system within the frames or can you only pack widgets into the frames?
@Codemycom
@Codemycom 4 жыл бұрын
You can use grid anytime.
@kurd_1
@kurd_1 4 жыл бұрын
how did you run it ?? plz answer❤😓
@Codemycom
@Codemycom 4 жыл бұрын
I show that in the video, right?
@kurd_1
@kurd_1 4 жыл бұрын
@@Codemycom no , i mean gui , this program name mingw?
@Codemycom
@Codemycom 4 жыл бұрын
@@kurd_1 the git bash terminal? git-scm.com
@kurd_1
@kurd_1 4 жыл бұрын
@@Codemycom yes
@kurd_1
@kurd_1 4 жыл бұрын
@@Codemycom thx sir 💜💜💜
@nalakakulathunga715
@nalakakulathunga715 4 жыл бұрын
Sir, I make tab. background colour is powder blue. I done this following code. Cal = ttk.Notebook(root) Cal1=ttk.Frame(cal, bg="powder blue") Cal.add(cal1, text= calculate) Cal.pack(epannd=1, fill="both") But I run the code, it is exit without opening gui
@Codemycom
@Codemycom 4 жыл бұрын
You are using lowercase to call your things cal and cal1 but you named then Cal and Cal1 uppercase
@nalakakulathunga715
@nalakakulathunga715 4 жыл бұрын
Sorry sir it is my comment typing mistake sir all of cal and cal1 was been types in lower cause... But it is didn't work...... Could you please solove that problem sir... It is very important to me
@anindyabhattacharjee47
@anindyabhattacharjee47 3 жыл бұрын
how to create more than two tabs????
@Codemycom
@Codemycom 3 жыл бұрын
In the same exact way, just make more
@anindyabhattacharjee47
@anindyabhattacharjee47 3 жыл бұрын
@@Codemycom what to write in fill attribute ?? after writing both it is showing error
@Codemycom
@Codemycom 3 жыл бұрын
@@anindyabhattacharjee47 I don't know what you're asking
@meirosetiger
@meirosetiger 4 жыл бұрын
it says eturn self.tk.call('wm', 'geometry', self._w, newGeometry) _tkinter.TclError: bad geometry specifier "500*500"
@Codemycom
@Codemycom 4 жыл бұрын
This line of code is wrong: root.geometry("500*550") It should be root.geometry("500x550") notice the x instead of *
@andrewburris1767
@andrewburris1767 4 жыл бұрын
This rules!
@Codemycom
@Codemycom 4 жыл бұрын
Thanks!
@techlead2.066
@techlead2.066 4 жыл бұрын
@t can anyone help me with how to make everything straight, thanks
@Codemycom
@Codemycom 4 жыл бұрын
Did you try using stickey=W+E
@MariusOdobasa
@MariusOdobasa 4 жыл бұрын
sticky= Defines how to expand the widget if the resulting cell is larger than the widget itself. This can be any combination of the constants S, N, E, and W, or NW, NE, SW, and SE. For example, W (west) means that the widget should be aligned to the left cell border. W+E means that the widget should be stretched horizontally to fill the whole cell. W+E+N+S means that the widget should be expanded in both directions. Default is to center the widget in the cell.
@kidkyle712
@kidkyle712 4 жыл бұрын
Hey ! I was wondering if there is a way to make a virtual joystick with Tkinter! I’ve seen your video on sliders and I was guessing perhaps its possible with 2 sliders but it’s not exactly the same I guess... Please help me out if anyone knows how to do this! I would appreciate it! Btw +1 sub, awesome channel
@Codemycom
@Codemycom 4 жыл бұрын
I'm sure there is, but I don't know exactly what you want to do so you'll have to hack around and try to figure it out.
@Harrisonkm20202
@Harrisonkm20202 2 жыл бұрын
HEISENBERG
@Codemycom
@Codemycom 2 жыл бұрын
lol
@redcrafter18
@redcrafter18 3 жыл бұрын
how can I change the color of the tab button? So the one where you click on it to get to the tab
@mariamkhanam4037
@mariamkhanam4037 3 жыл бұрын
What Does the ttk.NoteBook() Doo??
@Codemycom
@Codemycom 3 жыл бұрын
just what the video shows
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 102 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
The place layout method in tkinter
20:50
Atlas
Рет қаралды 9 М.
Multiple Tabs in Tkinter - Python GUI Tutorial
9:26
NeuralNine
Рет қаралды 5 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН
How To Create Apps In Python Using Tkinter!
17:50
b001
Рет қаралды 61 М.
Python Logging: How to Write Logs Like a Pro!
11:02
ArjanCodes
Рет қаралды 183 М.
Using tkinter with classes
28:23
Atlas
Рет қаралды 74 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН