Re: Disabling a button in a matrix
Re: Disabling a button in a matrix
- Subject: Re: Disabling a button in a matrix
- From: Tito Ciuro <email@hidden>
- Date: Mon, 15 Sep 2003 13:03:04 +0200
Scott, Jyrki and Lorenzo,
Thanks a lot for the help. It works great!
Best regards,
-- Tito
On 15/09/2003, at 12:53, Lorenzo wrote:
Hi,
you should act on the single cell and not on the whole matrix.
PB puts automatically the tags on each cell, so, in order to get the
single
cell (e.g. the cell with the tag = 3) you can use
[myMatrix cellWithTag:3]
then enable or disable that cell with
[[myMatrix cellWithTag:3] setEnabled:YES];
you can even know if the cell is enabled or not with
if([[myMatrix cellWithTag:3] isEnabled])
I made this test which enables and disables the cell 3
- (IBAction)DoThat:(id)sender
{
if([[myMatrix cellWithTag:3] isEnabled]){
[[myMatrix cellWithTag:3] setEnabled:NO];
}
else [[myMatrix cellWithTag:3] setEnabled:YES];
}
hope this helps.
Best Regards
--
Lorenzo
email: email@hidden
Message: 7
To: Cocoa Forum <email@hidden>
From: Tito Ciuro <email@hidden>
Subject: Disabling a button in a matrix
Date: Mon, 15 Sep 2003 06:41:46 +0200
Hello,
Given a matrix containing NSButtons, is it possible to disable one of
them? Or should I separate them into individual buttons and control
them manually?
Thanks,
-- Tito
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.