Python GUI with Tkinter - 9 - Creating Drop Down Menus

  Рет қаралды 311,333

thenewboston

thenewboston

Күн бұрын

Пікірлер: 237
@SteveBreese
@SteveBreese 9 жыл бұрын
# Remove the dashed line (- - - - - - - -) above the dropdown list subMenu = Menu(menu, tearoff=0)
@FelixIaccarino
@FelixIaccarino 9 жыл бұрын
Steve Breese thanks, this is really a simple and good advice
@mohamademad7687
@mohamademad7687 9 жыл бұрын
+Steve Breese no its 0
@tanweerahmad9049
@tanweerahmad9049 8 жыл бұрын
+Steve Breese Thanks, for me it's, smn=Menu(mn,tearoff=0); Pretty same thing.
@petyapavlov1324
@petyapavlov1324 8 жыл бұрын
+Steve Breese thank you xd
@AeroAndZero
@AeroAndZero 7 жыл бұрын
Thank you man
@librasaur5070
@librasaur5070 9 жыл бұрын
did "menu" look like a really weird word to you by the end?
@krisek98
@krisek98 7 жыл бұрын
I have read ur comment before watching video and I didn't get it, now I do..
@UnderscoreZeroLP
@UnderscoreZeroLP 7 жыл бұрын
also "edit" for me lol
@seanosaurusart1008
@seanosaurusart1008 7 жыл бұрын
There is no way in hell that menu is actually a word, i mean just look at him... menu This abomination should not exist!
@EvrendenNotlar
@EvrendenNotlar 7 жыл бұрын
It is cuz os menuception literraly happening
@shahman1
@shahman1 6 жыл бұрын
i swear, it did.
@OlubunmiAdewumi
@OlubunmiAdewumi 9 жыл бұрын
Thank God for the day I subscribed to this channel. Bucky, God Bless You.
@df6148
@df6148 5 жыл бұрын
Thanks for the great explanations! I feel like tkinter looks crappy at first but after giving it time you really get to see that you shouldn't judge it by how it looks. It has some really awesome features. Like what you just showed here. Thanks a ton.
@profskitty
@profskitty 10 жыл бұрын
Hey may I ask a question about how I would make a cascading menu that scrolls? I have a menu for a program I am doing that has about 50 different pieces per submenu, and I want to be able to have like an arrow so that it scrolls down. Would you know what I should try to do?
@21Blankenship
@21Blankenship 9 жыл бұрын
Happy birthday man, thanks for everything
@turboromy
@turboromy 7 жыл бұрын
This was a bit confusing when I first saw it on other guy's channel. New Boton's way is simple and straight forward. Thanks as always.
@christophershibles383
@christophershibles383 2 жыл бұрын
This is exactly what I was looking got. You gave me the basics and now I can use them and search for more "advanced" options. Thanks!
@mafianoodles
@mafianoodles 4 жыл бұрын
late to the party here - it's 2020 i think i need to lay down and watch this again :)
@rngeesus13
@rngeesus13 6 жыл бұрын
this is probably the hardest and most confusing lesson that I had with this Tkinter tutorial with bucky amongst the 14 lessons. Took me almost 2 hours to understand the whole thing and apply it on my own program.
@puraneshi
@puraneshi 8 жыл бұрын
also, to remove that first option that brings the cascade menu to another window: subMenu = Menu(menu, tearoff=0)
@TheSecondFlock
@TheSecondFlock 7 жыл бұрын
Thanks!
@kirkchu7304
@kirkchu7304 9 жыл бұрын
+thenewboston I can't get my menu to open in the frame. It open outside the frame at the top of my desktop screen. Any ideas on how to fix this?
@vikingtyty
@vikingtyty 8 жыл бұрын
If you're on a mac, that's just how it works. I was confused at first, but then realized none of my other apps have the menu within the app itself, it's always on the mac menu bar.
@takemybacon6053
@takemybacon6053 8 жыл бұрын
Why do i feel like menu isn't spelled right after writing it/
@jamz670
@jamz670 8 жыл бұрын
Because it's just a bit to simple of a spelling in the English language.
@bikebikey1302
@bikebikey1302 7 жыл бұрын
looooool same
@hungvuhoang7680
@hungvuhoang7680 7 жыл бұрын
TakeMyBacon same
@user-hi6cn3jm5c
@user-hi6cn3jm5c 6 жыл бұрын
because english language is stupid
@aarshdave9738
@aarshdave9738 6 жыл бұрын
It's happening to me and i'm only at 5:31
@ImSoSalty88
@ImSoSalty88 7 жыл бұрын
Just spent an hour wondering why my code wasn't working..... lable does not spell label
@dilshadomar5078
@dilshadomar5078 6 жыл бұрын
m2
@macrus7064
@macrus7064 6 жыл бұрын
tabel does not spell table
@samarbhojanefilms
@samarbhojanefilms 4 жыл бұрын
fuckkkk
@cyberguygame9096
@cyberguygame9096 4 жыл бұрын
Is it possible to create such a drop down menu on an Entry, such as that suggestions underneath the search line in Google?
@OkaiGabi
@OkaiGabi 7 жыл бұрын
If your program prints the "ok ok I wont...." right when you run it, be sure you did code """""command=doNothing)""""" and not """"command=doNothing())""". Watch out for the autocomplete that adds a set of parenthesis!
@onur199
@onur199 6 жыл бұрын
Hey I know this is a 1 year old comment, but how exactly can I give it a variable to run with then?
@suneelpandita3499
@suneelpandita3499 4 жыл бұрын
@@onur199 use lambda
@lamarsmith7677
@lamarsmith7677 6 жыл бұрын
did exactly but it ain't running.... line 13, in Menu.add_cascade(label="File", menu=subMenu) TypeError: add_cascade() missing 1 required positional argument: 'self'
@IVIagicful
@IVIagicful 4 жыл бұрын
Are you doing it exactly though? You have Menu capitalized which refers to the Tkinter's class Menu. You want to change it to menu which is the object's name.
@Diego4322237
@Diego4322237 7 жыл бұрын
Muchas gracias amigo, tu vídeo está genial!
@FSVideoFeatures
@FSVideoFeatures 8 жыл бұрын
Hi, (first, thank you for the videos, they are really good!) Question: when follow and reproduce your code, the window created is called TK and has no menus, the menus appear instead by the side of the compiler program (next to PyCharm) on the application menu bar! Worst, I have no idea why! Where can I put the Q to you or to people following this tutorials? Many thanks, Best, Fernando
@domn8t0r
@domn8t0r 6 жыл бұрын
I wish you actually WOULD have used a different word other than "menu". It really made it confusing understand which one was being called at times when everything is menu.
@xingyubian1441
@xingyubian1441 8 жыл бұрын
Hello, do you have an intermediate course for python tkinter?
@chancewatkins5071
@chancewatkins5071 5 жыл бұрын
awesome tutorial, probably the best explanation I've found on KZbin. I've Subscribed God Bless. However I was wondering if you could combine an input box and a dropdown list in order to create a "suggestion" list like that on the Google search bar. Do you think that is possible?
@koflin7213
@koflin7213 8 жыл бұрын
You make the best tutorials, thanks!
@_daniel.w
@_daniel.w 7 жыл бұрын
All done :D An hour but what ever :) from Tkinter import * root = Tk() class FullScreenApp(object): def __init__(self, master, **kwargs): self.master=master pad=3 self._geom='200x200+0+0' master.geometry("{0}x{1}+0+0".format( master.winfo_screenwidth()-pad, master.winfo_screenheight()-pad)) master.bind('',self.toggle_geom) def toggle_geom(self,event): geom=self.master.winfo_geometry() print(geom,self._geom) self.master.geometry(self._geom) self._geom=geom def main(): menu = Menu(root) root.configure(background='white') root.config(menu=menu) subMenu = Menu(menu, tearoff=0) # Gets rid of the '------' in the menu menu.add_cascade(label='File', menu=subMenu) # Creates a new menu item subMenu.add_command(label='New File') # Created a new item in the submenu subMenu.add_command(label='Open File...') subMenu.add_command(label='Open Folder...') subMenu.add_command(label='Open Recent') subMenu.add_command(label='Reopen with Encoding') subMenu.add_command(label='View into file') subMenu.add_command(label='Save') subMenu.add_command(label='Save with Encoding') subMenu.add_command(label='Save as...') subMenu.add_command(label='Save All') subMenu.add_separator() # Puts in a clean line without any spacing, '------' without the spacing subMenu.add_command(label='New Window') subMenu.add_command(label='Open Window') subMenu.add_separator() subMenu.add_command(label='Close File') subMenu.add_command(label='Revert File') subMenu.add_command(label='Close All Files') subMenu.add_separator() subMenu.add_command(label='Exit', command=exit) editMenu = Menu(menu, tearoff=0) # Same things menu.add_cascade(label='Edit', menu=editMenu) editMenu.add_command(label='Undo') editMenu.add_command(label='Redo') editMenu.add_command(label='Undo Selection') editMenu.add_separator() editMenu.add_command(label='Copy') editMenu.add_command(label='Cut') editMenu.add_command(label='Paste') editMenu.add_command(label='Paste and Indent') editMenu.add_command(label='Paste from History') editMenu.add_separator() editMenu.add_command(label='Line') editMenu.add_command(label='Comment') editMenu.add_command(label='Text') editMenu.add_command(label='Tag') editMenu.add_command(label='Mark') editMenu.add_command(label='Code Folding') editMenu.add_command(label='Convert Case') editMenu.add_command(label='Wrap') editMenu.add_command(label='Show Completions') editMenu.add_separator() editMenu.add_command(label='Sort Lines') editMenu.add_command(label='Sort Lines (Case Sensitive)') editMenu.add_command(label='Permute Lines') editMenu.add_command(label='Permute Slections') selectionMenu = Menu(menu, tearoff=0) menu.add_cascade(label='Selection', menu=selectionMenu) selectionMenu.add_command(label='Split into Lines') selectionMenu.add_command(label='Add Previous Line') selectionMenu.add_command(label='Add Next Line') selectionMenu.add_command(label='Single Selection') selectionMenu.add_command(label='Invert Selection') selectionMenu.add_separator() selectionMenu.add_command(label='Select All') selectionMenu.add_command(label='Expand Selection to Line') selectionMenu.add_command(label='Expand Selection to Word') selectionMenu.add_command(label='Expand Selection to Paragraph') selectionMenu.add_command(label='Expand Selection to Scope') selectionMenu.add_command(label='Expand Selection to Brackets') selectionMenu.add_command(label='Expand Selection to Indentation') selectionMenu.add_command(label='Expand slection to Tag') findMenu = Menu(menu, tearoff=0) menu.add_cascade(label='Find', menu=findMenu) findMenu.add_command(label='Find...') findMenu.add_command(label='Find Next') findMenu.add_command(label='Find Previous') findMenu.add_command(label='Incremental Find') findMenu.add_separator() findMenu.add_command(label='Replace...') findMenu.add_command(label='Replace Next') findMenu.add_separator() findMenu.add_command(label='Quick Find') findMenu.add_command(label='Quick Find All') findMenu.add_command(label='Quick Add Next') findMenu.add_command(label='Quick Skip Next') findMenu.add_separator() findMenu.add_command(label='Use Selection for Find') findMenu.add_command(label='Use Selection for Replace') findMenu.add_separator() findMenu.add_command(label='Find in Files...') findMenu.add_command(label='Find Results') viewMenu = Menu(menu, tearoff=0) menu.add_cascade(label='View', menu=viewMenu) viewMenu.add_command(label='Side Bar') viewMenu.add_command(label='Hide Minimap') viewMenu.add_command(label='Hide Status Bar') viewMenu.add_command(label='Hide Menu') viewMenu.add_command(label='Hide Console') viewMenu.add_separator() viewMenu.add_command(label='Enter Full Screen') viewMenu.add_command(label='Enter Distraction Free Mode') viewMenu.add_separator() viewMenu.add_command(label='Layout') viewMenu.add_command(label='Groups') viewMenu.add_command(label='Focus Group') viewMenu.add_command(label='Move File to Group') viewMenu.add_separator() viewMenu.add_command(label='Syntax') viewMenu.add_command(label='Indentation') viewMenu.add_command(label='Line Endings') viewMenu.add_separator() viewMenu.add_command(label='Word Wrap') viewMenu.add_command(label='Word Wrap Column') viewMenu.add_command(label='Ruler') viewMenu.add_separator() viewMenu.add_command(label='Spell Check') viewMenu.add_command(label='Next Misspelling') viewMenu.add_command(label='Prev Mispelling') viewMenu.add_command(label='Dictionary') gotoMenu = Menu(menu, tearoff=0) menu.add_cascade(label='Goto', menu=gotoMenu) gotoMenu.add_command(label='Goto Anything...') gotoMenu.add_separator() gotoMenu.add_command(label='Goto Symbol...') gotoMenu.add_command(label='Goto Symbol in Project...') gotoMenu.add_command(label='Goto Definition...') gotoMenu.add_command(label='Goto Line...') gotoMenu.add_separator() gotoMenu.add_command(label='Jump Back') gotoMenu.add_command(label='Jump Forward') gotoMenu.add_separator() gotoMenu.add_command(label='Switch File') gotoMenu.add_separator() gotoMenu.add_command(label='Scroll') gotoMenu.add_command(label='Bookmarks') gotoMenu.add_separator() gotoMenu.add_command(label='Jump to Matching Bracket') toolsMenu = Menu(menu, tearoff=0) menu.add_cascade(label='Tools', menu=toolsMenu) toolsMenu.add_command(label='Command Palette...') toolsMenu.add_command(label='Snippets...') toolsMenu.add_separator() toolsMenu.add_command(label='Build System') toolsMenu.add_command(label='Build') toolsMenu.add_command(label='Build With...') toolsMenu.add_command(label='Cancel Build') toolsMenu.add_command(label='Build Results') toolsMenu.add_command(label='Save All on Build') toolsMenu.add_separator() toolsMenu.add_command(label='Record Macro') toolsMenu.add_command(label='Playback Macro') toolsMenu.add_command(label='Save Macro...') toolsMenu.add_command(label='Macros') toolsMenu.add_separator() toolsMenu.add_command(label='Developer') projectMenu = Menu(menu, tearoff=0) menu.add_cascade(label='Project', menu=projectMenu) projectMenu.add_command(label='Open Project...') projectMenu.add_command(label='Switch Project') projectMenu.add_command(label='Quick Switch Project') projectMenu.add_command(label='Open Recent') projectMenu.add_separator() projectMenu.add_command(label='Save Project As...') projectMenu.add_command(label='Close Project') projectMenu.add_command(label='Edit Project') projectMenu.add_separator() projectMenu.add_command(label='New Workspace for Project') projectMenu.add_command(label='Save Workspace As...') projectMenu.add_separator() projectMenu.add_command(label='Add Folder to Project...') projectMenu.add_command(label='Remove all Folders from Project') projectMenu.add_command(label='Refresh Folders') preferencesMenu = Menu(menu, tearoff=0) menu.add_cascade(label='Preferences', menu=preferencesMenu) preferencesMenu.add_command(label='Browse Packages...') preferencesMenu.add_separator() preferencesMenu.add_command(label='Settings') preferencesMenu.add_command(label='Settings - Syntax Specific') preferencesMenu.add_command(label='Settings - Distraction Free') preferencesMenu.add_separator() preferencesMenu.add_command(label='Key Bindings') preferencesMenu.add_separator() preferencesMenu.add_command(label='Font') preferencesMenu.add_command(label='Color Scheme') preferencesMenu.add_separator() preferencesMenu.add_command(label='Package Settings') preferencesMenu.add_command(label='Package Control') helpMenu = Menu(menu, tearoff=0) menu.add_cascade(label='Help', menu=helpMenu) helpMenu.add_command(label='Documentation') helpMenu.add_command(label='Twitter') helpMenu.add_separator() helpMenu.add_command(label='Indexing Status...') helpMenu.add_separator() helpMenu.add_command(label='Remove License') helpMenu.add_separator() helpMenu.add_command(label='Check for Updates') helpMenu.add_command(label='Changelog...') helpMenu.add_command(label='About Sublime Text') main() root.title('Sublime Text 3') app=FullScreenApp(root) root.iconbitmap('stx.ico') root.mainloop()
@tonyiguru7595
@tonyiguru7595 5 жыл бұрын
compiles fine, but no tray icon, or any sign of the source code being run on a mac os x, and Python 3.6 in pycharm pro. The only change I made was to; from Tkinter import * to : from tkinter import * so I could load the tkinter module.
@tonyiguru7595
@tonyiguru7595 5 жыл бұрын
Edit here on you tube wouldn't work; had to use reply. I got the code to work by changing app=FullScreenApp(root) to app=FullScreenApp()
@ilorijiang8756
@ilorijiang8756 4 жыл бұрын
Great work Daniel!! Actually i have the same problem with tonyi above, i change "from Tkinter import *" to "from tkinter import *" and change "app=FullScreenApp(root)" to "app=FullScreenApp()" and your program work on Pycharm on my Mac :)
@제로-w3x
@제로-w3x 7 жыл бұрын
if you are on mac and the menu doesn't appear, it's in the very top system menu bar.
@marinad6712
@marinad6712 6 жыл бұрын
You're a genius!Thanks :-) Any idea about how to insert it inside the window ?
@mitsolee
@mitsolee 5 жыл бұрын
God Bless you, was getting majorly mind f..ed right there
@frederickosunde911
@frederickosunde911 5 жыл бұрын
Thanks man! Was almost losing my mind lol
@antonioilinovic2101
@antonioilinovic2101 8 жыл бұрын
Word menu doesn't make sense, after hearing it 1000 times lol
@zorkan111
@zorkan111 7 жыл бұрын
Semantic satiation (also semantic saturation) is a psychological phenomenon in which repetition causes a word or phrase to temporarily lose meaning for the listener, who then perceives the speech as repeated meaningless sounds.
@geni3595
@geni3595 5 жыл бұрын
Seriously It doesn't make any sense , it looks like a weird word now
@colbycox4250
@colbycox4250 10 жыл бұрын
Bucky you are the greatest teacher ever I worship you
@frat4700
@frat4700 4 жыл бұрын
dude i watched many many years later but u still god , i learn different think from u tytytytytyt :)
@AeroAndZero
@AeroAndZero 7 жыл бұрын
12:08 Your software is savage
@ThePCAssualt
@ThePCAssualt 10 жыл бұрын
Might be getting ahead of myself here, but does the tkinter offer the ability to customize the way the GUI actually looks? For example, in Mint the menu that we just created in in tkinter has a squared look to it. What if I would like to round the corners, or make the menu transparent...blah blah.? Is this possible?
@JacobHepworth
@JacobHepworth 10 жыл бұрын
Did you ever find out?
@asbjrnandersen8595
@asbjrnandersen8595 9 жыл бұрын
ThePCAssualt yep here is the code: haha got you maybe it does but if you're running python 2.7.5 then go and install the WX extenstion/plugin it will be able to do that but its way harder to code in WX trust me :D
@Mondreus313
@Mondreus313 7 жыл бұрын
Notepad++ for life. Love the tutorials btw, I didn't even know Python had GUIs. I've been using AHK for that and its not nearly as robust as Python.
@JanNaubert
@JanNaubert 7 жыл бұрын
Im not sure of the whole functionality of Notepad++ but i can also recommend sublime text.... it has python functionalty build in and everything.. you might wanna take a look :)
@Mondreus313
@Mondreus313 7 жыл бұрын
Notepad++ is great, it's really lacking on python syntax however. I just use PyCharm, same thing our bacon-loving teacher is using. Used the built in IDLE prior, but I was basically a butt-scratching tribal back then. If you ever use Notepad++, be very tentative on the download source, there are a LOT of phishing sites, advertisements, and 3rd party hosts loaded with trojans and malware plugins. That's a PSA.
@nadekang8198
@nadekang8198 5 жыл бұрын
if you ever want the exit button to work: subMenu.add_command(label="Exit", command=root.destroy)
@AlexandersArchways
@AlexandersArchways 5 жыл бұрын
I got my exit button to work with command=root.quit
@tonyiguru7595
@tonyiguru7595 5 жыл бұрын
@@AlexandersArchways me too
@하리학교학생회
@하리학교학생회 7 жыл бұрын
your code it only giving me a blank page,(my computer is mac) what going on?
@kbdemba9554
@kbdemba9554 7 жыл бұрын
your menu bar will be on mac menu bar, it will not be in the app. that's how mac works.
@thisnyper
@thisnyper 7 жыл бұрын
Brilliant man, I was looking for this freak menu at the windows box and it was only blank, it drove crazy. Thank you very much for remind us about Mac shows the Menu bar as usual.
@asminrai3114
@asminrai3114 6 жыл бұрын
And what about in linux ?? it is also giving blank page in my computer(linux)
@Zzzzzzzzzzzzzzzzzzzzr
@Zzzzzzzzzzzzzzzzzzzzr 10 жыл бұрын
I usually use the Self for my Tkinter but doing it your way is good as well.
@mrafayshams3089
@mrafayshams3089 9 жыл бұрын
hello I just had a quick question. I was working on a gui app, and I couldn't figure out how to fetch Option Menu's var.import tkinter var = tkinter.StringVar(root) choices = ['a' , 'b', 'c']option = tkinter.OptionMenu(root, var, *choices)option.pack(side ='left')now i wanna know how to fetch the values the user will select, in this case the options are "a", "b", and "c".waiting for your reply,Rafay
@NorashikinHasnan04
@NorashikinHasnan04 8 жыл бұрын
my window has multiple frame. Can anyone show me how to put drop down menu into specific frame
@Dimoonoo
@Dimoonoo 8 жыл бұрын
_tkinter.TclError: unknown option "-menu" can you telling me where is the problems?
@alexanderstorozhenko4435
@alexanderstorozhenko4435 8 жыл бұрын
I have the same error did you figure out what to do
@illonfononvaterca
@illonfononvaterca 8 жыл бұрын
Did you write Menu, with "M" capital letter?
@lukeslab1960
@lukeslab1960 5 жыл бұрын
Make sure that you are adding the menu to the root, not a frame. Example: root.config(menu=menu) NOT frame.config(menu=menu)
@asbjrnandersen8595
@asbjrnandersen8595 9 жыл бұрын
hi do you know how to add icons to those function becuase i have tried everything here is my code btw it works with normal labels image = PhotoImage(file=example.ico) editmenu.add_command(label="Cut", image, command=cut)
@anuragmishra7034
@anuragmishra7034 7 жыл бұрын
if submenu is also a menu, then why we didn't wrote root.config(menu=submenu) or... menu.config(menu=submenu)
@NiLem98
@NiLem98 7 жыл бұрын
because we said that it's our cascading menu, just look at line 13: menu.add_cascade(label="File", *menu=subMenu*)
@labsystem6166
@labsystem6166 5 жыл бұрын
Thanks Alot Man Your Videos Still Top in KZbin Until 2019 , sorry by my poor english hello world :)
@stew9671
@stew9671 8 жыл бұрын
I wanted to ask if Tkinter has a object wich can display Html code just like the browser does? Because i want to parse html and sort it and then rearrange it as a list but directly in the application.
@loosetehbest
@loosetehbest 5 жыл бұрын
how can i get kinter to update within itself? (using it to make a small battle system and the health wont decrease(except in pycharm))
@evpioneers2014
@evpioneers2014 6 жыл бұрын
Hello Bucky, I was wondering wether Tkinter could be made into a global webapp like, could I share a program I made with other people even if they don't have the Python IDLE?
@amitverma223
@amitverma223 4 жыл бұрын
you made it very confusing by writing menu everywhere in the code
@markcaruana4504
@markcaruana4504 7 жыл бұрын
error msg: idle's subprocess didnt make connection,,,either idle cant start a subprocess or personal firewall software is blocking>>maybe i have some software blocking it >?
@MaxGoddur
@MaxGoddur 7 жыл бұрын
Do you have a mini video for setting up pycharm the way you have it setup. Or maybe there is a way to import a config file you are using?
@pixelveteran
@pixelveteran 7 жыл бұрын
yes it's in his python 3 tutorial playlist i think
@_daniel.w
@_daniel.w 7 жыл бұрын
Okay, I suggest writing it on your own to get it in your head more but this is mine so far: from Tkinter import * def doNothing(): print('Button clicked') def Save(): print('Saved File') root = Tk() menu = Menu(root) root.config(menu=menu) subMenu = Menu(menu, tearoff=0) # Gets rid of the '------' in the menu menu.add_cascade(label='File', menu=subMenu) # Creates a new menu item subMenu.add_command(label='New File', command=doNothing) # Created a new item in the submenu subMenu.add_command(label='Open File', command=doNothing) subMenu.add_command(label='Open Folder', command=doNothing) subMenu.add_command(label='Save', command=Save) subMenu.add_command(label='Save as', command=Save) subMenu.add_separator() # Puts in a clean line without any spacing, '------' without the spacing subMenu.add_command(label='Settings', command=doNothing) subMenu.add_separator() subMenu.add_command(label='Exit', command=doNothing) editMenu = Menu(menu, tearoff=0) # Same things menu.add_cascade(label='Edit', menu=editMenu) editMenu.add_command(label='Copy', command=doNothing) editMenu.add_command(label='Cut', command=doNothing) editMenu.add_command(label='Paste', command=doNothing) editMenu.add_command(label='Redo', command=doNothing) root.mainloop()
@NoToBusinessCasual
@NoToBusinessCasual 3 жыл бұрын
Hmmm. I'm just wondering what you mean when you say "I'll put it on my forum".
@garthflint
@garthflint 6 жыл бұрын
Is there a video on how to use input boxes or how to have a dropdown selection open an input box?
@yaswanthpushpak3361
@yaswanthpushpak3361 7 жыл бұрын
When I tried the same code in python 2.7 it's showing syntax error.What's the problem?
@shahman1
@shahman1 6 жыл бұрын
there are quite a few differences between 2.x and 3.x. for example, in 2.7 it is print "ABC" and in 3.x it is print("ABC"). so you gotta look for such differences and replace those lines. :)
@ankitsethia9328
@ankitsethia9328 6 жыл бұрын
Where will I get the code you used in your tutorial?
@jkstuff3458
@jkstuff3458 3 жыл бұрын
Its not working for me, and I can't find the forums. I tried to copy everything he wrote, too. But nothing worked
@sakuramixcel4088
@sakuramixcel4088 7 жыл бұрын
do you also have a tutorial on how to make a search engine in tkinter?
@Repsack2
@Repsack2 7 жыл бұрын
He can probably show you how to make something that LOOKS like a search engine, but the 'Search' part is probably a job as large as half a university course
@khalilshaik6161
@khalilshaik6161 7 жыл бұрын
bucky i am very lucky to have you
@ktravers
@ktravers 5 жыл бұрын
Fantastic tutorial.
@victorlima8205
@victorlima8205 Жыл бұрын
Nice tutorial! I would like to know how open new window by clicking on drop options Could you help me?
@mohamedeweidat
@mohamedeweidat 6 жыл бұрын
I just spent 30 minutes trying to figure out why my menu doesn't appear on Mac, turns out it appears on your system menu bar at the top... been a Mac user for 5 years btw...
@davidsarpong3744
@davidsarpong3744 6 жыл бұрын
haha me too
@abela5450
@abela5450 5 жыл бұрын
literally just spent an hour trying to figure out the same problem, thank you so much haha
@baruchba7503
@baruchba7503 5 жыл бұрын
How do you append pycharm file menu to add convert ui to py ?
@RohanBikramThapa
@RohanBikramThapa 7 жыл бұрын
Can you please make a video tell how to create a shortcut key of the menu... like ctrl+s for save
@Draimanuchi
@Draimanuchi 8 жыл бұрын
How can I place this menu somewhere else than the corner?
@abela5450
@abela5450 5 жыл бұрын
mine doesn't say that is has an error but it just doesn't print anything
@GabrielsEpicLifeofGoals
@GabrielsEpicLifeofGoals 4 жыл бұрын
I got an error saying error in line 1476... XD
@Davisurena
@Davisurena 7 жыл бұрын
Did you just said "smell you later?" like Gary Oak?
@preetsinghchhabra6117
@preetsinghchhabra6117 8 жыл бұрын
hello! can any one help me? i am not able to find the written codes on bucky's website . Please give the link.
@suryakrishsaiyan
@suryakrishsaiyan 6 жыл бұрын
can anyone give the link of the forum where the source codes are available
@ambarchakravartty8180
@ambarchakravartty8180 6 жыл бұрын
how do i print stuff in my root window by clicking a button
@gracebennett3985
@gracebennett3985 5 жыл бұрын
Drink every time he says menu.
@mohamademad7687
@mohamademad7687 9 жыл бұрын
if you may i need something about commanding another app using my application (without a display)
@alexandarjelenic2880
@alexandarjelenic2880 9 жыл бұрын
+mohamad emad You want to "bind". This was covered in the 6th tutorial.
@kabir73722
@kabir73722 4 жыл бұрын
To remove that (window.option_add("*tearOff", False))
@vernsalgorithm4903
@vernsalgorithm4903 10 жыл бұрын
Hello Bucky. I think it'd be awesome if you do Android programming using Android Studio, with you explaining. That'd make my year.
@tafadzwamusakwa1548
@tafadzwamusakwa1548 6 жыл бұрын
How do I make multi-level drop down menu in tkinter e.g. a menu with cars,phones and cameras under cars I would like to have benz,renault,bmw under phones samsung,iphone,gtel cameras samsung,toshiba,mtyle
@rajeshwarirajeshwari8614
@rajeshwarirajeshwari8614 4 жыл бұрын
no clue why it isnt working for me, am just getting a plain window with no menus. Im using a Mac btw, does that have anything to do with this?
@dawidciubak9493
@dawidciubak9493 4 жыл бұрын
that should work on every OS, are you sure that your code looks like his/puts variables in the same places?
@rajeshwarirajeshwari8614
@rajeshwarirajeshwari8614 4 жыл бұрын
@@dawidciubak9493 Yeah, mah bad. Actually, the thing with Mac is that drop down menus dont appear on the window itself, they come on the top of the desktop. Realised that later. Thanks tho!!!
@userunp
@userunp 5 жыл бұрын
IT WONT WORK WITH CHANGE THE MENU VARIABLE PLEASE JUST Y
@miffimario5795
@miffimario5795 5 жыл бұрын
Why don't we need to pack() anything here?
@yakiengel7489
@yakiengel7489 3 жыл бұрын
Very helpful!
@abhiramianbu5137
@abhiramianbu5137 7 жыл бұрын
how to use quit function for root without frame?
@Issam_seb
@Issam_seb 5 жыл бұрын
Is there any python gui builder that allow me to create a mega and modern menubar or navbar?
@riccardopolimeno539
@riccardopolimeno539 5 жыл бұрын
Another way to create gui in python is using PyQt. It has more widget, components, but u need the licence, otherwise you can use the non-commercial version (pretty similar to premium version, but with something less)
@Issam_seb
@Issam_seb 5 жыл бұрын
@@riccardopolimeno539 thank you
@fakruu
@fakruu 7 жыл бұрын
what is the use of root.config() ?
@vantahaxer3355
@vantahaxer3355 7 жыл бұрын
omg i like it cuz its so simple and easy
@graceful_songs
@graceful_songs 9 жыл бұрын
Hey! I am trying to make a GUI to interface with arduino through the serial port... The problems i found: how can i press a button and receive data from the port infinitely and post this data on a text widget and let it scroll down automatically sir am new to python :( i need help
@Colstonewall
@Colstonewall 9 жыл бұрын
I'd go to StackOverflow and join, then ask your question(s). Or, join the Python help group, which is a google group (comp.lang.python).
@QuackersMcCrackers
@QuackersMcCrackers 9 жыл бұрын
There's tutorials made by Bucky, you know, if ya still need em.
@tiemenvangucht3198
@tiemenvangucht3198 4 жыл бұрын
Reminder for those on Mac the menu is not within the window, it's on top of your screen
@ArnavBarbaad
@ArnavBarbaad 7 жыл бұрын
Tutorial 9 and I still don't know how to display a message inside GUI
@ianmoseley9910
@ianmoseley9910 7 жыл бұрын
Arnav Barbaad put it in a widget, e.g. a label
@ashtab001
@ashtab001 7 жыл бұрын
'Menu' sounds so weird now,Dont you 'menu' me ever again
@Sam-wm1mo
@Sam-wm1mo 4 жыл бұрын
you did not tell us , how to size the text
@inclinedscorpio
@inclinedscorpio 5 жыл бұрын
*How's 2019 going guys ??*
@danielmalo1753
@danielmalo1753 5 жыл бұрын
Jesus, not here too
@inclinedscorpio
@inclinedscorpio 5 жыл бұрын
@@danielmalo1753 looks like it's not too good for you 😂
@danielmalo1753
@danielmalo1753 5 жыл бұрын
@@inclinedscorpio Gotta admit tho, this year spam thing on youtube is funny
@jkstuff3458
@jkstuff3458 3 жыл бұрын
also where the heck is his forum
@cameronkirby8189
@cameronkirby8189 6 жыл бұрын
+thenewboston my editMenu isn’t showing up on the program but the other one is and I’m doing exactly what you’re doing
@Spadeboy
@Spadeboy 9 жыл бұрын
Am I the only one who didn't like that tutorial as Ubuntu has its menu bar at the top, not in the application?? Can anyone help me with that???
@cedricboucher3719
@cedricboucher3719 7 жыл бұрын
same with macs i think its pretty cool that its not in the app though
@cedricboucher3719
@cedricboucher3719 7 жыл бұрын
you just cant build app the same way if youre trying to build a legitimate app or game
@Denverse
@Denverse 6 жыл бұрын
Just like my MAC
@yelbiar6956
@yelbiar6956 5 жыл бұрын
great. thank you
@aanchalkumari5435
@aanchalkumari5435 4 жыл бұрын
Okay after completing the video I can understand what people are talking about how weird word "menu" is.. damn!
@ankitbali2751
@ankitbali2751 5 жыл бұрын
where is your forum?
@subtlepositioning3353
@subtlepositioning3353 6 жыл бұрын
at about 5:17 the word menu loses all meaning.
@Ronan2kaii9
@Ronan2kaii9 8 жыл бұрын
Can someone help me please? Traceback (most recent call last): File "C:/Users/Ronan/PycharmProjects/Stepper Motor/GUI test.py", line 14, in menu.add_cascade(Label="File", menu=subMenu) File "C:\Python27\lib\lib-tk\Tkinter.py", line 2733, in add_cascade self.add('cascade', cnf or kw) File "C:\Python27\lib\lib-tk\Tkinter.py", line 2730, in add self._options(cnf, kw)) _tkinter.TclError: unknown option "-Label" What does this mean??
@adamwitte2033
@adamwitte2033 7 жыл бұрын
I got the same thing near enough. I'm clueless how to fix it
@ciaran624
@ciaran624 7 жыл бұрын
I think it's label not Label
@adamwitte2033
@adamwitte2033 7 жыл бұрын
Yes thank you I sorted it but yes that was the problem
@zakbuttery972
@zakbuttery972 9 жыл бұрын
This doesnt seem to work for me, I get a blank window when I run the program every time (Note im using a mac) Here is my source code can anyone understand what ive done wrong please?: from tkinter import * def FunctionB(): print("You used a drop down menu!") def FunctionA(): print("Why did you click this") MainWindow = Tk() menu = Menu(MainWindow) MainWindow.config(menu=menu) subMenu = Menu(menu) menu.add_cascade(label="Option 1", menu=subMenu) subMenu.add_command(label="Click me", command=FunctionB) subMenu.add_command(label="Don't click me", command=FunctionA) subMenu.add_separator() subMenu.add_command(label="Exit", command=FunctionA) editMenu = Menu(menu) menu.add_cascade(label="Another menu thingy", menu=editMenu) editMenu.add_command(label="Click disss", command=FunctionB) MainWindow.mainloop()
@zakbuttery972
@zakbuttery972 9 жыл бұрын
***** Found the problem! It was just me being an idiot.. On mac the drop down options appear at the top of the screen not the top of the program window
@asbjrnandersen8595
@asbjrnandersen8595 9 жыл бұрын
Zakky B yeah good for you that it worked :D
@tonyiguru7595
@tonyiguru7595 5 жыл бұрын
Same thing happened to me, a small white box with and red, yellow and green circles popped up, and my mind wasn't focused on what was going behind it. In my def-fence, I predominantly use windows machines and Buckys' Jedi mind controlling tactics made me blind to the Mac Os window.
@KingKhan-bi7kb
@KingKhan-bi7kb 5 жыл бұрын
thx bro
@lesliehurtado5986
@lesliehurtado5986 5 жыл бұрын
mine runs blank :/
@bobn8r53
@bobn8r53 7 жыл бұрын
How do I change the menu font??
@bobn8r53
@bobn8r53 7 жыл бұрын
To answer my own question, when you declare [menu = Menu(root, font="helvetica 14 bold")] and for each [submenu=Menu(menu, font = "helvetica 14 bold")] of course it doesn't have to be helvetica it could be times, or Verdana etc. and the size and bold italic etc. immediately after the font name.
@tonyiguru7595
@tonyiguru7595 5 жыл бұрын
@@bobn8r53 The code did not seem to change anything on a Mac os x in the menu, but did work on the sub menu. thanks
@FinetalPies
@FinetalPies 4 жыл бұрын
subMenu = Menu(menu) Menu has ceased to be a word I recognize as real
@mchojo4646
@mchojo4646 7 жыл бұрын
subscriber number 1,552,750
@OriginalJoseyWales
@OriginalJoseyWales 7 жыл бұрын
FSMENU.add.cascade(label="Subject", Menu = FSsubMENU) AttributeError: 'function' object has no attribute 'cascade' Hmmm...
@riccardopolimeno539
@riccardopolimeno539 5 жыл бұрын
When u post a problem with ur code please post all the code, not just only the error and the line with error. Otherwise i cant understand the problem. Try post it on stackoverflow
@salihfurkan8132
@salihfurkan8132 2 жыл бұрын
it's not add.cascade but add_cascade. Btw that's 5 years old comment but yeah :D
Python GUI with Tkinter - 10 - Creating a Toolbar
7:19
thenewboston
Рет қаралды 195 М.
Python GUI with Tkinter - 1 - Introduction
8:38
thenewboston
Рет қаралды 1,3 МЛН
Flipping Robot vs Heavier And Heavier Objects
00:34
Mark Rober
Рет қаралды 59 МЛН
怎么能插队呢!#火影忍者 #佐助 #家庭
00:12
火影忍者一家
Рет қаралды 39 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 119 МЛН
Python GUI with Tkinter - 2 - Organizing your Layout
11:15
thenewboston
Рет қаралды 585 М.
Python GUI with Tkinter - 8 - Using Classes
9:15
thenewboston
Рет қаралды 339 М.
Menu Bars With tKinter - Python Tkinter GUI Tutorial #46
11:02
Codemy.com
Рет қаралды 102 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 207 М.
Create a GUI app with Tkinter - Step by Step Tutorial
23:56
Python Simplified
Рет қаралды 615 М.
Python GUI with Tkinter - 13 - Shapes and Graphics
9:52
thenewboston
Рет қаралды 192 М.
Flipping Robot vs Heavier And Heavier Objects
00:34
Mark Rober
Рет қаралды 59 МЛН