• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Disabling a button in a matrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Disabling a button in a matrix


  • Subject: Disabling a button in a matrix
  • From: Lorenzo <email@hidden>
  • Date: Mon, 15 Sep 2003 12:53:40 +0200

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.

  • Follow-Ups:
    • Re: Disabling a button in a matrix
      • From: Tito Ciuro <email@hidden>
  • Prev by Date: Re: Disabling a button in a matrix
  • Next by Date: Re: Disabling a button in a matrix
  • Previous by thread: Re: Disabling a button in a matrix
  • Next by thread: Re: Disabling a button in a matrix
  • Index(es):
    • Date
    • Thread