By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,676 Members | 2,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,676 IT Pros & Developers. It's quick & easy.

Tkinter- Disabling of Check Box

100+
P: 440
Hi,

Could anybody help me in providing the sample code for disabling the Check box option.

-PSB
May 31 '07 #1
Share this Question
Share on Google+
4 Replies


bartonc
Expert 5K+
P: 6,596
Hi,

Could anybody help me in providing the sample code for disabling the Check box option.

-PSB
Expand|Select|Wrap|Line Numbers
  1. myCheckBox.config(enabled=False)
Or something very close to that.
May 31 '07 #2

100+
P: 440
Expand|Select|Wrap|Line Numbers
  1. myCheckBox.config(enabled=False)
Or something very close to that.

self.CBut1= Checkbutton(self.T7,text="Sample",variable=CheckBu tton1Var,state=DISABLED)

-PSB
May 31 '07 #3

100+
P: 440
Expand|Select|Wrap|Line Numbers
  1. Sample
self.CBut1= Checkbutton(self.T7,text="Sample",variable=CheckBu tton1Var,state=DISABLED)

-PSB
Expand|Select|Wrap|Line Numbers
  1. Sample
  2. self.CBut1= Checkbutton(self.T7,text="Sample",variable=CheckButton1Var,state=DISABLED)
  3.  
May 31 '07 #4

bartonc
Expert 5K+
P: 6,596
self.CBut1= Checkbutton(self.T7,text="Sample",variable=CheckBu tton1Var,state=DISABLED)

-PSB
Yep, that's the one. I knew it was something like that. Here's the key:
Just about anything that can be set with keyword arguments, as in
state=DISABLED
can be set with config(). As in
Expand|Select|Wrap|Line Numbers
  1. self.CBut1.config(state=DISABLED)
May 31 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.