Binding Dropdown Menus and Combo Boxes - Python Tkinter GUI Tutorial #45

  Рет қаралды 127,474

Codemy.com

Codemy.com

Күн бұрын

In this video I'll show you how to bind drop down menus (OptionMenus) and Combo Boxes with tKinter and Python so that you don't have to click a button to take action based on your selection.
Normally, after you select something from a drop down menu, you have to then click a button to take some action. But what if you could take the action just based on clicking and selecting from the drop down menu itself...without clicking a button afterward?
That's what I'll show you in this video...

Пікірлер: 216
@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
@tentra7548
@tentra7548 2 жыл бұрын
Hey, just want to say thanks for this excellent video! Your explanations are awesome. Including a use case of how to add logic to a combo box helped me a lot! Keep up the awesome content.
@DanielSilva-fv8br
@DanielSilva-fv8br 4 жыл бұрын
Great video! I've been trying to bind a combobox for like 1 hour. Thank you.
@Codemycom
@Codemycom 4 жыл бұрын
Glad it helped!
@eitangreenberg6255
@eitangreenberg6255 3 жыл бұрын
thank you very much!! already watched over 15 episodes which I really needed for the chat program i'm currently working on!
@Codemycom
@Codemycom 3 жыл бұрын
Glad you found them useful!
@good-gpt2-chatbot
@good-gpt2-chatbot 3 жыл бұрын
Thank you very much sir, I can't explain how much you've helped me!
@Codemycom
@Codemycom 3 жыл бұрын
Happy to hear it!
@jorge1869
@jorge1869 Жыл бұрын
I can't explain how I had not found this channel before. New subscriber.
@Codemycom
@Codemycom Жыл бұрын
Awesome
@tutoriaisdeinstrucoesdecel8455
@tutoriaisdeinstrucoesdecel8455 4 жыл бұрын
Thank you very much for the smooth content and your great humor.
@Codemycom
@Codemycom 4 жыл бұрын
My pleasure!
@bxstiii
@bxstiii 3 жыл бұрын
Comboy
@chendian-jing6037
@chendian-jing6037 2 жыл бұрын
Supper great video. I extended your example codes to my company project to develop strategies to industrial problems. I really appreciate your help.
@Codemycom
@Codemycom 2 жыл бұрын
Glad you found it helpful!
@kapibara2440
@kapibara2440 2 ай бұрын
Great work from John! Thank you 😊
@Codemycom
@Codemycom 2 ай бұрын
welcome
@charxcx_Purr
@charxcx_Purr 3 жыл бұрын
Yey! Finally I found a great tutorial 😍 Thanks!
@Codemycom
@Codemycom 3 жыл бұрын
Welcome!
@sujitsingh7279
@sujitsingh7279 4 жыл бұрын
Thanks a lot for this video sir. Keep making videos on tkinter as I am learning to develop app watching your videos.
@Codemycom
@Codemycom 4 жыл бұрын
Glad you're enjoying them!
@manjunathanc1389
@manjunathanc1389 3 жыл бұрын
It clears my doubt. Thank You !
@Codemycom
@Codemycom 3 жыл бұрын
You’re welcome
@__leelight
@__leelight 2 жыл бұрын
Amazing videos and simple .Thank you man
@Codemycom
@Codemycom 2 жыл бұрын
Thank you!
@chillwavefrequency8108
@chillwavefrequency8108 4 жыл бұрын
I love your videos man! Thank You so much! I am currently working on a project like most people here and I have a question: I have a dropdown menu with a list of numbers from 1 to 10 and I want my customer to be able to fill the dropdown menu just by clicking on the keyboard number. I would really appreciate it if you could help me with this. Thank You!
@RyanDanielG
@RyanDanielG 2 жыл бұрын
Feed the algorithm! Great vid
@nitinkashyap1821
@nitinkashyap1821 3 жыл бұрын
this was extremely helpful thank you sir
@Codemycom
@Codemycom 3 жыл бұрын
Glad it helped
@bondiliyeshesh1999
@bondiliyeshesh1999 3 жыл бұрын
hello. thank you for the video. but i have a doubt, i want a function to be executed for no matter what the selected option from the combobox. i guess i have to use for loop but i am having trouble how to do it. please shred some knowledge in this regard
@NoureddineBahi
@NoureddineBahi 2 жыл бұрын
You are a great prof...specifiquely your smail...thanks from morocco in north afriqua
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@asaadkittaneh2928
@asaadkittaneh2928 2 жыл бұрын
great video, thank you, you are a genius.
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@anintrovertabroad2065
@anintrovertabroad2065 2 жыл бұрын
I'd like to see how to do this where the options are the results of a function. So if I'm pulling employee names from file names with a function getEmployeeName, how do I assign the output of that function to the Options for the drop down. As you've shown here, its not very flexible. I need to be able to have the options change according to the files selected.
@whitebird365
@whitebird365 4 жыл бұрын
Very interesting.. Thank you! I hope that you're gonna make more tutorials in that ttk module :-)
@Codemycom
@Codemycom 4 жыл бұрын
Probably so :-p
@tonystark2358
@tonystark2358 4 жыл бұрын
yeah bro, there are very few videos on youtube who teach ttk very well
@Codemycom
@Codemycom 4 жыл бұрын
@@tonystark2358 for sure
@neiljohnmorales6718
@neiljohnmorales6718 3 жыл бұрын
how would i do if my project is about font size and font style using combobox (my whole project is about text formatting with sample)
@hosamsayed2652
@hosamsayed2652 3 жыл бұрын
Hi, Thanks for the tutorial. Can I make the scrollbar in the combobox at the left side. I am writing in combobox values in Arabic so when i choose a value from dropdown like ' I like your tutotial'. It implemented as 'tutorial your like I'.
@randomdude7386
@randomdude7386 2 жыл бұрын
Yeah you can do that with .grid() instead of .pack
@serious6037
@serious6037 2 жыл бұрын
how do you make previously picked list outcome to hide, after picking the next item from the list?? 6:18
@jussitoivanen5097
@jussitoivanen5097 3 жыл бұрын
Thank you Mr. White!
@Codemycom
@Codemycom 3 жыл бұрын
Ha!
@sivasundaram781
@sivasundaram781 2 жыл бұрын
sir, thank you for your video. but in combobox we press a letter the cursor cant go that word. what can i do?
@daneshpatel5638
@daneshpatel5638 3 жыл бұрын
Can we use if else in function checking the clicked check box is eight Or wrong
@helenayeung1020
@helenayeung1020 Жыл бұрын
can we use combobox without defining options ? e.g. option=list(np.sort(wf['raw data column header'].unique ?
@NotEnoughTime-cf2pi
@NotEnoughTime-cf2pi 3 ай бұрын
Is there any way to nest a list box in a combobox. I need a multiselect option?
@babysaga6726
@babysaga6726 3 жыл бұрын
Hi John, thanks for this tutorial. May I know how to display the output in just one line instead of showing everything you've selected? So if I choose Monday, it will display Monday and if Tuesday, the result from Monday will be replaced by Tuesday and will not create rows of what I've selected? Also, can I create a button out of what I'd selected and linked to open a file? Thank you!
@Codemycom
@Codemycom 3 жыл бұрын
Once you select a thing, you can do whatever you want with it. To learn how to use labels and buttons, check the playlist for their basic usage
@EduardoRandall
@EduardoRandall 2 жыл бұрын
Hey, friend. Have you found the solution to your issue? I'm having the same issue right now and it would help me a lot. Thank you!
@MultiGoldensilver
@MultiGoldensilver 3 жыл бұрын
which video covers combo boxes?
@jerrysavarino2113
@jerrysavarino2113 2 жыл бұрын
Hi John. Loving your videos! One aspect of my app that I am struggling with is that I have around 6 different comboboxes. 1 combobox is the 'master' whereby whatever value is selected from the list, will make 1 or 2 comboboxes (depending which ones are relevant) appear. Each time you select a different value from this 1 combobox, the linked comboxes are hidden/shown. I am trying to use a bind on the 'master' combobox and then in that function, create multiple 'if' statements to link the other comboxes to the relevant value in the 'master' combobox. I am trying to add a .destroy() in this function so that the non-related comboboxes are hidden but it doesn't really seem to be working. Is there a better way to do this? Hope I have explained my issue ok!
@Codemycom
@Codemycom 2 жыл бұрын
If you destroy a thing, it's gone for good...you likely don't want to do that. You can just hide it with pack_forget() and reshow it again with pack()
@jerrysavarino2113
@jerrysavarino2113 2 жыл бұрын
@@Codemycom Hi John, thanks for your reply! I am using grid() on the widgets and I actually found that grid_remove() seems to do what I need. What is the main difference between grid_forget() and grid_remove()?
@margaretlai2494
@margaretlai2494 3 жыл бұрын
Hi John, can we jump to a particular spot of the dropdown list instead of scrolling all the way down? Say by clicking "S" on the keyboard which then send us to "Saturday"?
@Codemycom
@Codemycom 3 жыл бұрын
You might be able to do that with binding..but I’ve never tried it.
@mounttaineer
@mounttaineer 3 жыл бұрын
HI, great videos. I have a combobox which then has a dependent listbox that brings up several option based on the drop down value. i was able to do it by using another of your tutorial, it is really cool, and I would not have been able to do it just by reading the descriptions. I also want to display the value of the drop down as you show in this video, and I have that working. The issue I am having is getting both of the functions working when in the binding, only the last function listed works. I tried two separate functions, still only the last one works, I tried using comma or "And" between the two, but still only the last function called will work. my_combo.bind("", display, parks_listbox) - here is a universal version of my bind code. Any ideas?
@mounttaineer
@mounttaineer 3 жыл бұрын
i figures it out, just write a new function or set them = True.
@nelsonbeneche2372
@nelsonbeneche2372 Жыл бұрын
Best videos
@Codemycom
@Codemycom Жыл бұрын
Thanks!
@tonyabadia860
@tonyabadia860 4 жыл бұрын
hello, thanks a lot for your video it is very helpful, I would like to ask you a question, actually I have almost the same code as yours : combobox=ttk.Combobox(toplevel,values=listebox,width=75) combobox.grid(row=nb_row,column=1) combobox.bind("",action) and the action function is : def action(event): print(combobox.get()) but when I run it it says that combobox is not defined, could you help me please ?
@Codemycom
@Codemycom 4 жыл бұрын
try naming it something other than combobox
@noureddinen72
@noureddinen72 10 ай бұрын
hi Thanks for this excellent video. I have a litle problem here, when i select a value from a combox, the value selected is not showing immediatly in the box, it waits until the main action of the program finished, can you help me to solve this problem. Cdlt
@kosidairy
@kosidairy 3 жыл бұрын
sir i need a help in combobox. when i type the first letter so it shows all the items in combobox related to the similar first letter. plzz help me out sir
@__leelight
@__leelight 2 жыл бұрын
Thanks!
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@nandhinisivakumar3523
@nandhinisivakumar3523 3 жыл бұрын
Thankyou for the code, I have a doubt like after passing a value through ComboSelected to a function I need that value to be passed to another function - which is working through another button??how could I make that possible??
@Codemycom
@Codemycom 3 жыл бұрын
Call the other function from inside the first function, passing whatever along inside it: second_function(pass_a_thing)
@jacktoddy9783
@jacktoddy9783 Жыл бұрын
Now, here's the thing - I make useful applications for people to interface with, such as quiz tables for self-assessment respecting climate change. The sort of thing whereby you open a box, select a button; and that loops to another issue through combi dropdowns - all old fashioned I guess. Why? because human life is complex when taking in account all of the intricate paths and foibles we possess. People like 'buttons' and 'boxes' as they wish to open the combi box; it is intuitive to them. Whereby, they select an option and scroll on through to another set of questions; and so on ... If a box appears, that imprints into their minds better - the lesson of 'what they are responsible for through their actions' registers. The point I am making is that although this is an excellent tutorial video, you appear to be a 'coder' rather than a 'programmer'. To me the difference is huge. One provides the code, the other is more philosophical through knowing what to design code for - the end product's purpose. I would have liked this video more if it had buttons designed into the GUI. Nonetheless, I have subscribed to your channel.
@Codemycom
@Codemycom Жыл бұрын
well the name of the channel is codemy.com...so yeah, I focus on coding.
@seshududdu8308
@seshududdu8308 3 жыл бұрын
Thank you very much for your tkinter videos. Could you guide , is there any option for autofill the combobox list
@Codemycom
@Codemycom 3 жыл бұрын
Not without hacking together something
@SmartProgrammer
@SmartProgrammer 2 жыл бұрын
How can we put to combo box default value? like("MONTH") But it should not be on my list.
@ankitha4797
@ankitha4797 3 жыл бұрын
Thank you, great videp! One question, could you please show how to create a multiple select combobox with drop down ?
@Codemycom
@Codemycom 3 жыл бұрын
I think I've already done a video about that on the playlist
@sinamobasheri3632
@sinamobasheri3632 4 жыл бұрын
Thank you Mr 🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@Codemycom
@Codemycom 4 жыл бұрын
You are very welcome
@benjaguzman4957
@benjaguzman4957 4 жыл бұрын
how can i use de variable returned from comboclick in other function? thanks
@Codemycom
@Codemycom 4 жыл бұрын
Depends on how you want to do that
@jacquesimbert1644
@jacquesimbert1644 3 жыл бұрын
Much appreciated W.W.
@Codemycom
@Codemycom 3 жыл бұрын
Ha
@Kennerdoll
@Kennerdoll 2 жыл бұрын
John, how can I use the value selected on a Combobox in another function? I have tried to use a return type and make a variable global but still getting errors
@Codemycom
@Codemycom 2 жыл бұрын
In the same way you pass anything to a function
@ArunYadav-ke2nu
@ArunYadav-ke2nu 8 ай бұрын
How to make a dropdown box that is scrollable and shows 5 elements at once and have nearly 60 elements? Please Help
@charliefoo7581
@charliefoo7581 4 жыл бұрын
Thank you for the Tkinter videos. I have a quick question: Is it possible to get the list position of the user selection instead of the text itself?
@Codemycom
@Codemycom 4 жыл бұрын
Sure, likely in the normal way you would find a list position...right? Play around with it...
@raghunathansundaresan8017
@raghunathansundaresan8017 2 жыл бұрын
just use index function to find the position using the text.
@KornJohnGaming
@KornJohnGaming 3 жыл бұрын
can you do a video on updating the dropdown when u add to options?
@ZombieKing05220
@ZombieKing05220 Жыл бұрын
hey, been a while but have you had any luck? i need help with this
@claudineievangelistanascim2562
@claudineievangelistanascim2562 3 жыл бұрын
Hi Codemy. Thank you for sharing this content. You've helped me (20210324 20:06pm brazil)
@sambleyle7192
@sambleyle7192 4 жыл бұрын
Do you have a video on how to clear the selected values in combo box and text widgets after you've sent those values to a database or searched for them, etc.?
@Codemycom
@Codemycom 4 жыл бұрын
yes
@sambleyle7192
@sambleyle7192 4 жыл бұрын
@@Codemycom link? I'm struggling to find it
@chrisfrom3cheapdudes769
@chrisfrom3cheapdudes769 2 жыл бұрын
how would you return the option selected to a variable? Not inside of the window, but just store the selection into a variable in the code.
@Codemycom
@Codemycom 2 жыл бұрын
In the same way you create any variable ever. variable_name = clicked.get()
@radhayamini9761
@radhayamini9761 4 жыл бұрын
how can we clear the previous selection...like override the label text displayed when we change the selection??
@Codemycom
@Codemycom 4 жыл бұрын
I think I discuss that in the playlist
@swarajsamal6864
@swarajsamal6864 4 жыл бұрын
Can we attached it in CSV/XML row ? I need a drop-down list attached with CSV and then want to access in HTML. is it possible. Pls pls explain
@Codemycom
@Codemycom 4 жыл бұрын
Yes it's possible, you'll have to figure it out yourself tho.
@ryuokami8924
@ryuokami8924 Жыл бұрын
Nice tuto ! But i have a question. How change the color of the text after you selected it ? (not change the selectbackground but the text itself) of the combobox ?
@malakalbakri2392
@malakalbakri2392 Жыл бұрын
cant u config it and use fg?
@ryuokami8924
@ryuokami8924 Жыл бұрын
@@malakalbakri2392 Yep i can thx !
@livenere
@livenere 4 жыл бұрын
Hi i am trying to make a combo from my database. I got the combox to appear, but no data is in it myCombo = ttk.Combobox(root, value= c.execute("SELECT DISTINCT DefectCategory FROM [Teardown ].[dbo].[Defect]")) myCombo.set("Defects Category") myCombo.grid(row=13, column=1) This the code im using, any ideals?
@Codemycom
@Codemycom 4 жыл бұрын
Yeah, what made you think you could make a database call from inside the combo box? Put all that stuff in a variable outside the combo box in the normal way you would make a database call, and try putting the variable in the combo box.
@livenere
@livenere 4 жыл бұрын
@@Codemycom I did the same thing for the drop down and it worked clicked = StringVar() clicked.set("Defects Category") drop = OptionMenu(root, clicked, *c.execute("SELECT DISTINCT DefectCategory FROM [Teardown ].[dbo].[Defect]")) drop.grid(row=7, column=1, columnspan=2, pady=10, padx=10, ipadx=80) I try turning it into a variable and see if that works. Thanks
@cunninghamb505
@cunninghamb505 4 жыл бұрын
great vid, any plans to do anything on Kivy
@Codemycom
@Codemycom 4 жыл бұрын
Yes, actually
@denniszignin7745
@denniszignin7745 4 жыл бұрын
Great Tutorial. I have a question about combo: is a way to let open the combo after click? I want show a long item list even after the click...
@Codemycom
@Codemycom 4 жыл бұрын
Not sure exactly what you mean
@denniszignin7745
@denniszignin7745 4 жыл бұрын
@@Codemycom sorry for late, I have asked a banality. The behaviour of combo is exactly what I want... 🤦🏻‍♂️
@Codemycom
@Codemycom 4 жыл бұрын
@@denniszignin7745 I don't know what any of those words together mean...
@alphainfinitum3445
@alphainfinitum3445 2 жыл бұрын
My combo box behaves differently when I have it inside a function compared to when it's not inside a function. What I noticed is that when it's not inside a function, the default item is displayed, but once I put the same combobox code inside a function, the default item doesn't display. Otherwise, the rest of the code works as expected. Can any one help with this, or has anyone experienced this before.
@Codemycom
@Codemycom 2 жыл бұрын
No, that shouldn't be the case.. you're doing something wrong there. You likely forgot to copy the code that sets the default into the function.
@STEFANisNOOB
@STEFANisNOOB 3 жыл бұрын
Can anyone tell me how to add a option list on a canvas?I've been struggling with this option list for so long
@avpzquizi2103
@avpzquizi2103 3 жыл бұрын
Hello Sree Vignesh, I have the same problem can you help me ? or you still don't know?
@minute-ai
@minute-ai 2 жыл бұрын
how to chnage the color in of the widget in azure theme?
@Codemycom
@Codemycom 2 жыл бұрын
I don't know what azure theme is
@randatebina7421
@randatebina7421 4 жыл бұрын
Where do I write (bd,relief , pady, padx)?? In order to change the shape
@Codemycom
@Codemycom 4 жыл бұрын
what the videos to see.
@alphainfinitum3445
@alphainfinitum3445 2 жыл бұрын
I don't believe you can change the shape of a widget. Try creating another widget with the disired shape, then kill the old widget.
@justone4272
@justone4272 4 жыл бұрын
@Codemy.com can you please help, I am using ttk themes but It doesn't show OptionMenu() as an option, how do I work around this?
@Codemycom
@Codemycom 4 жыл бұрын
What do you mean, doesn't show it as an option? That's not a thing...
@justone4272
@justone4272 4 жыл бұрын
Wait- What?
@himanshukhanna5583
@himanshukhanna5583 4 жыл бұрын
How do we get value store in a variable, if we use multiple combox & want to get value on single button click.. like, DOB !?
@Codemycom
@Codemycom 4 жыл бұрын
Sorry, not sure what you mean
@himanshukhanna5583
@himanshukhanna5583 4 жыл бұрын
@@Codemycom suppose we want to enter user date of birth, so we create 3 combobox (dd-mm-yyyy) now how do we get all three values on single button click..? & Store then in an empty variable.. like empty=dd-mm-yyyy
@malakalbakri2392
@malakalbakri2392 Жыл бұрын
when i link the combobox to a list it doesnt work unless its an already exsisting list, how can i link it to the box while letting the user create the items of the list?
@Codemycom
@Codemycom Жыл бұрын
you can .config() it later with whatever list you want
@malakalbakri2392
@malakalbakri2392 Жыл бұрын
@@Codemycom thanks sm
@shubhanshusharma5372
@shubhanshusharma5372 3 жыл бұрын
Can i call this from toplevel it shows that top is not defined
@Codemycom
@Codemycom 3 жыл бұрын
Sure you can
@krishnapatil136
@krishnapatil136 3 жыл бұрын
Hi, 1st of all, you are doing an amazing job, I want to knw hw to change font/Size of options of the combobox, n can i set it to Readonly, whats syntax for that? Also how to change font/size of whatever we are displaying through myLabel = Label(root, text= " ")
@alphainfinitum3445
@alphainfinitum3445 2 жыл бұрын
Let me answer at least your first question. To make the combobox read-only, you should include inside its definition an option called 'state', and set that equal to 'readonly'. So here is the syntax: myBox=ttk.Combobox(root, state='readonly', font=(' ',15),...and so on). That should make the combobox read-only. The way I defined the font here will adjust the size of the selection inside the combo box, but not its drop down menu. So you will notice that the size of the drop-down menu itself will not change. I discovered a way to tackle that, but it's too complicated to describe here. If you have solved that problem and an easier solution please share it with us.
@TaxManianDevil
@TaxManianDevil Жыл бұрын
Does this work the same on customtkinter?
@Codemycom
@Codemycom Жыл бұрын
nothing works quite the same with customtkinter...
@ananyasingh1976
@ananyasingh1976 3 жыл бұрын
can you please tell me what to do in order to get a value from my dropdown menu to display on a new window?
@Codemycom
@Codemycom 3 жыл бұрын
the same way you get a value from a dropdown menu any time.
@ananyasingh1976
@ananyasingh1976 3 жыл бұрын
@@Codemycom I am made a product page where the user can buy the desired products and choose the quantity of products through the dropdown menu. I want that quantity to be displayed on a new window where I am making the invoice. Can you help me get through this problem? I'm a complete newbie and am learning Tkinter from your channel and I have to make this GUI and submit it to my school soon.
@Codemycom
@Codemycom 3 жыл бұрын
@@ananyasingh1976 Just make the variables global: global variable_name and then you can access them from other windows.
@ananyasingh1976
@ananyasingh1976 3 жыл бұрын
@@Codemycom thank you so much!
@monzonco
@monzonco 2 жыл бұрын
I would like to see a video that one combo box impacts the content of another combo box for example if the combo box has the days of the week the other combo box is set with classes available in a university for each day. The data could be come from a database table,
@Codemycom
@Codemycom 2 жыл бұрын
Check the playlist...dependent dropdowns...pretty sure I've already done it.
@rakeshshankar2154
@rakeshshankar2154 3 жыл бұрын
Sir, can we give any background color for combobox?
@hishamashour5771
@hishamashour5771 3 жыл бұрын
root = tk.Tk() combostyle = ttk.Style() combostyle.theme_create('combostyle', parent='alt', settings = {'TCombobox': {'configure': {'selectbackground': 'blue', 'fieldbackground': 'red', 'background': 'green' }}} ) # ATTENTION: this applies the new style 'combostyle' to all ttk.Combobox combostyle.theme_use('combostyle') # show the current styles # print(combostyle.theme_names()) combo = ttk.Combobox(root, values=['1', '2', '3']) combo['state'] = 'readonly' combo.pack() entry = tk.Entry(root) entry.pack() root.mainloop() Taken from Stackoverflow.com
@rakeshshankar2154
@rakeshshankar2154 3 жыл бұрын
@@hishamashour5771 Thank you so much
@hishamashour5771
@hishamashour5771 3 жыл бұрын
@@rakeshshankar2154 Most Welcome!
@naveeni2644
@naveeni2644 3 жыл бұрын
Im trying do combobox which will get data from excel and display in scorlled text box
@Codemycom
@Codemycom 3 жыл бұрын
Cool
@joeyblaq9952
@joeyblaq9952 2 жыл бұрын
👍🔥
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@nellaimuthuvels7099
@nellaimuthuvels7099 2 жыл бұрын
How can we increase the sixe and height of the combobox
@Codemycom
@Codemycom 2 жыл бұрын
Change the font size of the text
@christophertnguyen
@christophertnguyen 3 жыл бұрын
i tried running this on my mac and it would crash and log me out ... any suggestions on how to run this properly?
@Codemycom
@Codemycom 3 жыл бұрын
There's no reason for that to happen just because you're on a mac...you must have some typo or error in your code..
@christophertnguyen
@christophertnguyen 3 жыл бұрын
@@Codemycom hi I completely copied word for word ... but what I did realize that I was not the only one ... a quick google search gave me this which is related but not exactly your code ... github.com/matplotlib/matplotlib/issues/14999 and I realized if I used a conda version of python 3.7.0 version and not 3.7.6 it worked perfectly and no crashing involved. Specifically this: Setup the environment using Python 3.7.0, as @ImpatientLearning suggested. $ conda create --n python=3.7.0 pip $ conda activate Thanks for your videos!!
@christophertnguyen
@christophertnguyen 3 жыл бұрын
@@Codemycom bugs.python.org/issue37833 also see this
@Codemycom
@Codemycom 3 жыл бұрын
@@christophertnguyen interesting
@emmanuelsambo875
@emmanuelsambo875 3 жыл бұрын
What if I want my new option to take the position of my first option. E.g, if my first choice was 'yay! It's Friday', can I make my second option, say Tuesday, replace 'yay! It's Friday' ?
@Codemycom
@Codemycom 3 жыл бұрын
Sure, why not
@emmanuelsambo875
@emmanuelsambo875 3 жыл бұрын
I tried it, but I'm having difficulties, could you throw a little light on it please?🙏🏿
@Codemycom
@Codemycom 3 жыл бұрын
@@emmanuelsambo875 update your label...my_label.config(text=new_stuff) or whatever
@EduardoRandall
@EduardoRandall 2 жыл бұрын
Hey, friend. Have you found the solution to your issue? I'm having the same issue right now and it would help me a lot. Thank you!
@alphainfinitum3445
@alphainfinitum3445 2 жыл бұрын
@@emmanuelsambo875 you have to manipulate the list from where your selections come. Once you do that, it will be reflected in the drop down of the combo box. This issus has nothing to do with the combo box itself. So write code that will manipulate the list, and your problem will be solved. Just make sure your list has global scope, or you can carefully pass the list as an argument when making the appropriate function call.
@raulprahoveanu3980
@raulprahoveanu3980 3 жыл бұрын
Hello,I really need help,I want to make multiple OptionMenus with integers,then make a button to add the integers selected from the optionmenu.Can you help me?
@Codemycom
@Codemycom 3 жыл бұрын
I can just point you to my tkinter playlist...I don't see anything difficult or weird about what you want to do..you should find answers to all of it in the playlist
@raulprahoveanu3980
@raulprahoveanu3980 3 жыл бұрын
@@Codemycom i just ant to know how to store multiple optionmenus in a variable
@raulprahoveanu3980
@raulprahoveanu3980 3 жыл бұрын
want*
@Codemycom
@Codemycom 3 жыл бұрын
@@raulprahoveanu3980 make the variable a list, store whatever you want in it
@raulprahoveanu3980
@raulprahoveanu3980 3 жыл бұрын
@@Codemycom if i use clicked.get(),it just store the last optionmenu,i dont know how to store all of them:(
@tazulislam2698
@tazulislam2698 2 жыл бұрын
How to searchable/autocomplete combo box?
@Codemycom
@Codemycom 2 жыл бұрын
I think I have a video on that in the playlist
@errorhostnotfound1165
@errorhostnotfound1165 3 жыл бұрын
'from tkinter import *' raises a bunch of Wildcard errors. What should I do about it?
@Codemycom
@Codemycom 3 жыл бұрын
Get rid of whatever weird IDE you're using and use the tools I do.
@errorhostnotfound1165
@errorhostnotfound1165 3 жыл бұрын
@@Codemycom What tools do you use?
@Codemycom
@Codemycom 3 жыл бұрын
@@errorhostnotfound1165 Sublime Text Editor and git-scm.com git bash terminal
@alphainfinitum3445
@alphainfinitum3445 2 жыл бұрын
You also have to import ttk. The very next line of what you wrote should say: from tkinter import ttk, that's where combo boxes live.
@abed839
@abed839 4 жыл бұрын
i apply every thing but only the window come up but not the menu
@Codemycom
@Codemycom 4 жыл бұрын
Are you on a mac?
@sujitsingh7279
@sujitsingh7279 4 жыл бұрын
Hi sir , I have one question. You must have seen in websites where there is a little icon adjacent to a text box which has a calendar icon on which we can click to select our date, month and year. How to do that in tkinter?
@sujitsingh7279
@sujitsingh7279 4 жыл бұрын
If it is not possible (calendar icon) then how to take date as a user input in tkinter ?
@Codemycom
@Codemycom 4 жыл бұрын
@@sujitsingh7279 I'm not sure what you mean about the calendar icon...
@sujitsingh7279
@sujitsingh7279 4 жыл бұрын
@@Codemycom sir I just found the exact word on internet. Actually it's called date picker. So when we want someone to enter a date we provide them an icon where a user clicks and he/she chooses the date, month and year and once a user selects that it enters the date in the text box or entry box. I hope it was explanatory. :)
@Codemycom
@Codemycom 4 жыл бұрын
@@sujitsingh7279 There's no built in tkinter thing for that..you could hack something together to make something similar, but too complicated to put in a comment here.
@sujitsingh7279
@sujitsingh7279 4 жыл бұрын
@@Codemycom Thanks for the response sir. What are you going to teach us next in this amazing tkinter series?
@bakchodgamer2882
@bakchodgamer2882 4 жыл бұрын
def click(): lab = Label(root, text=var.get()) lab.place(x=100,y=100) list = ["hello","hey","huuu"] Var=Stringvar() Var.set(list[0]) Op=OptionMenu(root, Var, *list, command=click) Op.pack() When I select any option from option box this gives me a error TypeError: click() takes 0 positional arguments but 1 was given Please help me how can I solve this error
@Codemycom
@Codemycom 4 жыл бұрын
I don't think you can pack and place at the same time...
@bakchodgamer2882
@bakchodgamer2882 4 жыл бұрын
@@Codemycom I tried it again by packing the things but it still gives the same error
@bakchodgamer2882
@bakchodgamer2882 4 жыл бұрын
@@Codemycom but I found the solution for that error from stackoverflow website "command = lambda event : click()" This gives no error everything works properly But "command = click" worked in your video how?
@mithunm507
@mithunm507 2 жыл бұрын
How to insert separator to combobox in tkinter
@Codemycom
@Codemycom 2 жыл бұрын
What do you mean?
@sakshishafi6223
@sakshishafi6223 3 жыл бұрын
Sir How to increase size of text in Comboboxes sir. Sir please Reply sir
@Codemycom
@Codemycom 3 жыл бұрын
In the normal way you change text font size
@alphainfinitum3445
@alphainfinitum3445 2 жыл бұрын
@@Codemycom I had a more specific issues with fonts for combo box: The drop down menu will have a different size from the item in the entry of the combo box. Do you please have a better way of solving that. The method I used altered all combo boxes in my project, instead of just modifying the specific one.
@eidnanrohod8788
@eidnanrohod8788 2 жыл бұрын
is that heisenberg coding?
@Codemycom
@Codemycom 2 жыл бұрын
Haha
@tonystark2358
@tonystark2358 4 жыл бұрын
sir, I am having a problem with my code. Help me please from tkinter import * window = Tk() def re(string): print(string) for i in range(0,11): Checkbutton(window, text=f"N{i}", command=lambda:re(i)).pack() window.geometry("600x500+120+120") window.mainloop() when I click a checkbutton, I should have got different number according to checkbutton but I am getting 10 every time, I click any checkbutton Help me please, I am working on my first application. I learn coding from youtube and I am a high school kid.
@Codemycom
@Codemycom 4 жыл бұрын
you aren't setting a variable in your checkbox.
@MoMo-id6ri
@MoMo-id6ri 3 жыл бұрын
Combo boxes at 7:52
@Codemycom
@Codemycom 3 жыл бұрын
yep
@Momo-bb2fn
@Momo-bb2fn 3 жыл бұрын
@@Codemycom ur great
@Momo-bb2fn
@Momo-bb2fn 3 жыл бұрын
​@@Codemycom holy crap i just saw ur linked in: bannerclicks, vitalbio, submission-spider... i don't know if you yourself responded to me, but if you are John Elder, why do you do these tutorials (i mean to ask with genuine, heart-felt curiosity)? What drives you to these specific actions (teaching on youtube)?
@Codemycom
@Codemycom 3 жыл бұрын
@@Momo-bb2fn Thanks!
@Codemycom
@Codemycom 3 жыл бұрын
@@Momo-bb2fn Yeah it's me....I do it because I enjoy it.
@skystep2
@skystep2 3 жыл бұрын
In nearly every tutorial, programmers using import * - that is not helping... trust me. Person may get confused is this build in thing or other.
@Codemycom
@Codemycom 3 жыл бұрын
Sorry, but you're wrong.
Menu Bars With tKinter - Python Tkinter GUI Tutorial #46
11:02
Codemy.com
Рет қаралды 100 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 57 МЛН
Playing hide and seek with my dog 🐶
00:25
Zach King
Рет қаралды 31 МЛН
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 24 М.
The Complete Guide to Python Virtual Environments!
15:52
teclado
Рет қаралды 335 М.
Adding a Full Screen ScrollBar - Python Tkinter GUI Tutorial #96
15:08
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 388 М.
Add Scrollbars to List Boxes - Python Tkinter GUI Tutorial #62
20:19
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,5 МЛН
How to organize your notes in Obsidian // The LATCH method
15:55
Nicole van der Hoeven
Рет қаралды 182 М.
ComboBoxes and Bindings - Tkinter TTKBootstrap 5
9:31
Tkinter․com
Рет қаралды 8 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 57 МЛН