Check Button Demo: disabled : CheckBox « GUI Tk « Python

Home
Python
1.2D
2.Application
3.Buildin Function
4.Class
5.Data Structure
6.Data Type
7.Database
8.Development
9.Dictionary
10.Event
11.Exception
12.File
13.Function
14.GUI Pmw
15.GUI Tk
16.Language Basics
17.List
18.Math
19.Network
20.String
21.System
22.Thread
23.Tuple
24.Utility
25.XML
Python » GUI Tk » CheckBox 




Check Button Demo: disabled
Check Button Demo: disabled

from Tkinter import *

class Dummy: pass
var = Dummy()

root = Tk()
root.title('Checkbutton')
for castmember, row, col, status in [
    ('A'0,0,NORMAL)('B'0,1,NORMAL),
    ('C'1,0,DISABLED)('D'1,1,NORMAL),
    ('E',2,0,NORMAL)('F'2,1,NORMAL)]:
    setattr(var, castmember, IntVar())
    Checkbutton(root, text=castmember, state=status, anchor=W,
      variable = getattr(var, castmember)).grid(row=row, column=col, sticky=W)
root.mainloop()



           
       














Related examples in the same category
1.Get check box statesGet check box states
2.Save check box statesSave check box states
3.A check box buttonA check box button
4.Add a check box to a DialogAdd a check box to a Dialog
5.Check box bar: get selected check boxCheck box bar: get selected check box
6.Border for a group of check boxesBorder for a group of check boxes
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.