Learn Python tkinter GUI checkboxes easy ✔️

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.พ. 2025
  • Python checkbox checkbutton tkinter GUI tutorial for beginners
    #Python #checkbox #checkbutton #tkinter #GUI #tutorial #beginners
    from tkinter import *
    def display():
    if(x.get()==1):
    print("You agree!")
    else:
    print("You don't agree :(")
    window = Tk()
    x = IntVar()
    python_photo = PhotoImage(file='Python.png')
    check_button = Checkbutton(window,
    text="I agree to something",
    variable=x,
    onvalue=1,
    offvalue=0,
    command=display,
    font=('Arial',20),
    fg='#00FF00',
    bg='black',
    activeforeground='#00FF00',
    activebackground='black',
    padx=25,
    pady=10,
    image=python_photo,
    compound='left')
    check_button.pack()
    window.mainloop()

ความคิดเห็น • 40

  • @BroCodez
    @BroCodez  4 ปีที่แล้ว +9

    from tkinter import *
    def display():
    if(x.get()==1):
    print("You agree!")
    else:
    print("You don't agree :(")
    window = Tk()
    x = IntVar()
    python_photo = PhotoImage(file='Python.png')
    check_button = Checkbutton(window,
    text="I agree to something",
    variable=x,
    onvalue=1,
    offvalue=0,
    command=display,
    font=('Arial',20),
    fg='#00FF00',
    bg='black',
    activeforeground='#00FF00',
    activebackground='black',
    padx=25,
    pady=10,
    image=python_photo,
    compound='left')
    check_button.pack()
    window.mainloop()

  • @slickwillie3376
    @slickwillie3376 3 ปีที่แล้ว +3

    I like the way you neatly list the attributes in readable form. I haven't seen anyone else do this yet, but it is so much better, more pleasant to code this way.

  • @mohamedselim6547
    @mohamedselim6547 3 ปีที่แล้ว +1

    Brief, to the point
    Thanks for sharing
    Keep it up

  • @piotrkopcewicz5227
    @piotrkopcewicz5227 2 ปีที่แล้ว +1

    I agree that this is a great tutorial !! thanks as always

  • @megabond81
    @megabond81 ปีที่แล้ว

    Thanks buddy! Your video is the best on youtube.

  • @amanda-janedeagrella5020
    @amanda-janedeagrella5020 ปีที่แล้ว +1

    Fantastic explanation so professional 🙏🏼👏🏻

  • @manuelvaal1257
    @manuelvaal1257 3 ปีที่แล้ว

    so far it is lovely. you are a legend

  • @Amir_Plays_non_stop
    @Amir_Plays_non_stop 3 ปีที่แล้ว +1

    As usual great video!

    • @BroCodez
      @BroCodez  3 ปีที่แล้ว

      Thank you Game!

  • @abigailtesfaye3122
    @abigailtesfaye3122 11 หลายเดือนก่อน

    thank you thank you thank you so much i love u

  • @creator6714
    @creator6714 11 หลายเดือนก่อน

    Was this video helpful? ✓

  • @lam8322
    @lam8322 3 ปีที่แล้ว +4

    Still 30 video left eventually , I wonder what to learn about python after this course ?

  • @susyleethgonzalez5585
    @susyleethgonzalez5585 ปีที่แล้ว

    Thanks!!! I hope your pandas course

  • @PratikGaikwad-t6p
    @PratikGaikwad-t6p 3 หลายเดือนก่อน

    help me lot for the exam

  • @barara8794
    @barara8794 3 ปีที่แล้ว

    NIce

  • @truquichan
    @truquichan ปีที่แล้ว

    Great!

  • @rubenc4696
    @rubenc4696 8 หลายเดือนก่อน

    Thanks

  • @murilosilvestre7736
    @murilosilvestre7736 3 ปีที่แล้ว

    Nice!

  • @uuhju7004
    @uuhju7004 3 ปีที่แล้ว

    nice

  • @lw9954
    @lw9954 2 ปีที่แล้ว

    Ty Bro!

  • @shahzodsayfiddinov6516
    @shahzodsayfiddinov6516 3 ปีที่แล้ว

    Thank you!

  • @EissaAlahdul
    @EissaAlahdul 2 ปีที่แล้ว

    شكرا

  • @orfredymelobeltran5237
    @orfredymelobeltran5237 3 ปีที่แล้ว

    I love this one

  • @_Modul_Asis
    @_Modul_Asis 2 ปีที่แล้ว

    Please make video how to insert image in GUI

  • @Desperate4Freedom.
    @Desperate4Freedom. 3 ปีที่แล้ว

    hi Dude, how you doing? how did u manage have same bg color image as main? help

  • @borja4015
    @borja4015 4 ปีที่แล้ว +2

    Hi, I have a question unrelated to this video, but you always replied to comments so I guessed I might post it here.
    I have made some projects with python on my own, and I thought about including them somehow in my Curriculum Vitae, so that people can verify that they are mine while still looking kind of professional.
    I'm not really sure how to do it. My first thought was a link to something like GitHub that is free (maybe GitHub itself if its free version allows to do what I want). Would you recommend something?
    Thanks in advance!

    • @BroCodez
      @BroCodez  4 ปีที่แล้ว +1

      I don't have much experience with GitHub, so I don't want to give you the wrong advice. But I do know that many people do post their code to share in a form that is called a 'gist'. That may be what you are looking for.

  • @beingzero7541
    @beingzero7541 3 ปีที่แล้ว

    Wow!

  • @darind2158
    @darind2158 4 ปีที่แล้ว

    PLS REPLY how do u get that screen i only can use untilted file which isnt like that output

  • @jhassee
    @jhassee 2 ปีที่แล้ว

    myMan

  • @nuonduch585
    @nuonduch585 3 ปีที่แล้ว

    If have two checkbox I want to add to ButtonGroup like java how

  • @kauedasilva1072
    @kauedasilva1072 ปีที่แล้ว

    But what if you want to be able to have the checkbox set by default?

    • @InformatikaVseProsto
      @InformatikaVseProsto ปีที่แล้ว

      You can do this using the set() method. For example:
      t=IntVar()
      t.set(1)
      k = Checkbutton(window,
      text="message text",
      onvalue=1,
      ofvalue=0)
      k.pack()

  • @gustavoaponte1814
    @gustavoaponte1814 ปีที่แล้ว

    meow meow meow~!

  • @darind2158
    @darind2158 4 ปีที่แล้ว

    can u tell me why i cant ser the box

    • @BroCodez
      @BroCodez  4 ปีที่แล้ว

      hmmmm are you using .pack() ?

  • @haniyasaeed1853
    @haniyasaeed1853 2 ปีที่แล้ว

    Hey bro
    My active Foreground
    And active background
    Does not work
    What should I do

  • @philtoa334
    @philtoa334 3 ปีที่แล้ว

    oky.

  • @SuperStarEevee
    @SuperStarEevee 2 ปีที่แล้ว

    Thank you!