Learn Python tkinter GUI menubars easy 🧾

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024

Комментарии • 52

  • @BroCodez
    @BroCodez  4 года назад +21

    from tkinter import *
    def openFile():
    print("File has been opened!")
    def saveFile():
    print("File has been saved!")
    def cut():
    print("You cut some text!")
    def copy():
    print("You copied some text!")
    def paste():
    print("You pasted some text!")
    window = Tk()
    openImage = PhotoImage(file="file.png")
    saveImage = PhotoImage(file="save.png")
    exitImage = PhotoImage(file="exit.png")
    menubar = Menu(window)
    window.config(menu=menubar)
    fileMenu = Menu(menubar,tearoff=0,font=("MV Boli",15))
    menubar.add_cascade(label="File",menu=fileMenu)
    fileMenu.add_command(label="Open",command=openFile,image=openImage,compound='left')
    fileMenu.add_command(label="Save",command=saveFile,image=saveImage,compound='left')
    fileMenu.add_separator()
    fileMenu.add_command(label="Exit",command=quit,image=exitImage,compound='left')
    editMenu = Menu(menubar,tearoff=0,font=("MV Boli",15))
    menubar.add_cascade(label="Edit",menu=editMenu)
    editMenu.add_command(label="Cut",command=cut)
    editMenu.add_command(label="Copy",command=copy)
    editMenu.add_command(label="Paste",command=paste)
    window.mainloop()

    • @eissamohamed7584
      @eissamohamed7584 Год назад +1

      The only thing, you did not demonstrate step by step , how to save and invoke the png images. The script keeps returning error, in run time. Can’t find the files or directories. Despite , putting the code and images in the same path. Will keep trying!!!!

    • @TheJossephc
      @TheJossephc Год назад

      you have to save the png files on the same directory of your script.
      @@eissamohamed7584

    • @parvgupta7363
      @parvgupta7363 7 месяцев назад

      same problem faced by me ?? What to do ?? @BroCodez @@eissamohamed7584

  • @mohammedtoufiq6763
    @mohammedtoufiq6763 3 года назад +5

    Bro i just don't have any words to thank you ❤️
    Your doing such a very good and impressive job by providing courses of programming language
    So the needy's can acces..
    I just wanna thank you for helping us all 👍
    Keep growing up,
    Soon you will have more than 10million subs 🥺

  • @daro-chan5123
    @daro-chan5123 Год назад +1

    Dang!! I can't say "thank q" enough. Love u man and I will be your follower from now on. Cant wait for new course

  • @ramarromarrone7756
    @ramarromarrone7756 4 года назад +3

    Brooo when i have a question you upload a video on that ahaha. A huge thank you, really.

    • @BroCodez
      @BroCodez  4 года назад +3

      haha yeah that happens sometimes lol

  • @LeandroGambim
    @LeandroGambim 11 месяцев назад

    amazing content! I'm learning python step by step with you and I'm already able to create a script that has been used by other people at my job! thanks a lot!

  • @HypnosisBear
    @HypnosisBear 2 года назад +2

    Thanks Bro! This video was really helpful!

  • @AuthorSpot
    @AuthorSpot Год назад

    it sounds so cute when you says "hey you! yeah I'm talking to you..." 😅

  • @partages5957
    @partages5957 2 года назад

    Hello, it's a pleasure to watch your videos. Also, I have a question? how to put an image in the menu bar in Tkinter "Python" instead of putting for example: ""Exit" I want to replace and put an image instead.

  • @PathToEverywhere
    @PathToEverywhere 11 месяцев назад +1

    I have a question please : how can we resize the images so they appear correctly once we run the program ?

  • @cristiucvladimir7909
    @cristiucvladimir7909 5 месяцев назад

    Thanks for video!

  • @Amir_Plays_non_stop
    @Amir_Plays_non_stop 3 года назад +1

    Ayo great video as usual 😂

  • @aadijha3347
    @aadijha3347 Год назад

    Amazing tutorial thank you so much.

  • @computeradvantageslimited6518
    @computeradvantageslimited6518 2 года назад

    Very useful and educative video. Thanks for your efforts. Can you advise how to run a python script from a menu button click. iam building a small application. i have coded and tested the 5 pysimplegui scripts but need to pull them together and run from menu button click. Any suggestions

  • @hydarhydar2338
    @hydarhydar2338 9 дней назад

  • @Pedro-pv2pp
    @Pedro-pv2pp 3 года назад +1

    Show de bola kkk conteúdo de qualidade

  • @arpanshah355
    @arpanshah355 Год назад

    i droped a comment, smashed the like button, AND subscribed to become a bro

  • @piotrkopcewicz5227
    @piotrkopcewicz5227 Год назад

    great as always !!! thx

  • @vijayakumara4081
    @vijayakumara4081 Год назад

    Thank you

  • @uuhju7004
    @uuhju7004 3 года назад +1

    nice!

  • @al-cadaalachannel3194
    @al-cadaalachannel3194 Год назад

    Grateful 🙏

  • @monwil3296
    @monwil3296 4 года назад +2

    Thanks Bro 👌

  • @lucyledezma709
    @lucyledezma709 4 года назад +2

    Thanks Bro!.

    • @BroCodez
      @BroCodez  4 года назад +2

      You're welcome Lucy!

  • @mehmetburhankucuk8276
    @mehmetburhankucuk8276 4 года назад

    How to create a menu bar in form border using python, just like in visual studio, pycharm, adobe photoshop applications

  • @beingzero7541
    @beingzero7541 2 года назад

    Wow!

  • @lw9954
    @lw9954 2 года назад

    Ty bro!

  • @Minecraft-xw2gx
    @Minecraft-xw2gx 2 года назад

    Goog

  • @englishtests1588
    @englishtests1588 3 года назад

    Good day how to do for showing rectangles ovals when tapping the menu

  • @gxtombeats
    @gxtombeats 2 года назад +1

    Thanks (;

  • @thatkidd7252
    @thatkidd7252 21 день назад

    can you link the images you used?

  • @21.m0
    @21.m0 3 года назад

    Thanks

  • @WilsakoGaming_Official
    @WilsakoGaming_Official 9 месяцев назад

    How do I make the menubar be in a file other than main.py and import it into the main file.

  • @onlyLewds
    @onlyLewds 2 года назад

    why do we do it this way instead of packing it like the other gui items?

  • @robinsrirr
    @robinsrirr 2 года назад

    Hi when I try to add an image to menu just like you I don't get any error but the sub menu don't appear .

    • @robinsrirr
      @robinsrirr 2 года назад

      Sorry I was making a mistake with variable now it works , thanks

  • @gustavoaponte1814
    @gustavoaponte1814 Год назад

    meow meow meow~!

  • @hamzazad5258
    @hamzazad5258 6 месяцев назад

    every time i add imaged to my widows it doesnt work! the images become giant

  • @ronaldjsc1849
    @ronaldjsc1849 2 года назад

    I'm having a problem uploading pictures into pycharm

  • @riyapalkar1178
    @riyapalkar1178 3 года назад

    How to open file from the Menubar .

  • @djoezi3662
    @djoezi3662 2 года назад

    hey world 🖐🏼
    only for me this doesn't work on macOS?

    • @bowenliu4100
      @bowenliu4100 2 года назад

      me too, have you found a solution yet?

    • @bowenliu4100
      @bowenliu4100 2 года назад +1

      Oh i figured it out, it does work. but the menu appears in the actual apple menu on the top

    • @djoezi3662
      @djoezi3662 2 года назад

      @@bowenliu4100 no, I switched to JavaScript 😄

    • @rinajumps
      @rinajumps 10 месяцев назад

      @@bowenliu4100 oh i couldn't get what i was doing wrong, but it just appears on the top menu! thank you!

  • @jhassee
    @jhassee Год назад

    comment

  • @Foo321
    @Foo321 4 года назад +4

    Bruh