#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2010
    Posts
    14
    Rep Power
    0

    Tkinter checkbutton


    I am making a tkinter GUI and i wanted to make a row of checkbuttons numbered one through ten and a row just below it numbered 11 through 20. Can anyone help me? Please! Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    383
    Rep Power
    0
    It's a lame response, but such a bad question deserves it: http://lmgtfy.com/?q=tkinter+checkbutton

    Comments on this post

    • dwblas agrees : This is a nice forum, except for those few people who think we are their personal servants.
    Last edited by delnan; May 22nd, 2010 at 06:48 AM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2010
    Posts
    14
    Rep Power
    0

    Thanks! (not)


    Thank you captain obvious. Does anyone have a more polite and helpful answer?

    EDIT: I apologize for my angry outbreak. I did not mean to use you as my personal slave. I am new to python and was just asking for some beginner help. Sorry!
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    635
    Rep Power
    68
    Can you show the code you have tried?

    Hint -- if you use a for loop, an if statement and a grid you can place your buttons nicely.
    Last edited by Dietrich; May 22nd, 2010 at 01:33 PM.
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2010
    Posts
    14
    Rep Power
    0
    Originally Posted by Dietrich
    Can you show the code you have tried?

    Hint -- if you use a for loop, an if statement and a grid you can place your buttons nicely.
    Again i am new to python and have no source code that i tried. That is what i was looking for. Thanks!
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2010
    Posts
    14
    Rep Power
    0
    here are codes i tried. I need a row of ten checkbuttons and then another row of ten under it and they need to be labeled one through 20.

    Code:
    from Tkinter import *
    import tkMessageBox
    import Tkinter
    
    top = Tkinter.Tk()
    CheckVar1 = IntVar()
    CheckVar2 = IntVar()
    C1 = Checkbutton(top, text = "Music", variable = CheckVar1, \
                     onvalue = 1, offvalue = 0, height=5, \
                     width = 20)
    C2 = Checkbutton(top, text = "Video", variable = CheckVar2, \
                     onvalue = 1, offvalue = 0, height=5, \
                     width = 20)
    C1.pack()
    C2.pack()
    top.mainloop()
    and...

    Code:
    from Tkinter import *
    root = Tk()
    cVbl = IntVar()
    c = Checkbutton(root,variable=cVbl)
    c.pack(side=LEFT)
    root.mainloop()

IMN logo majestic logo threadwatch logo seochat tools logo