• 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
Re: Custom NSCell mouse events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom NSCell mouse events


  • Subject: Re: Custom NSCell mouse events
  • From: Corbin Dunn <email@hidden>
  • Date: Mon, 14 Jun 2010 08:42:04 -0700

On Jun 10, 2010, at 9:43 AM, Michael Hanna wrote:

> OK I'm really stumped on this one. I want to make a checkbox with a
> NSTextFieldCell combined together. It's important that the checkbox
> goes ON if the mouse hits the box, NOT the text. I've accomplished
> this, more or less, but the issue is receiving the mouse event because
> I click one checkbox in a row, but ALL of them turn to NSOnState. I
> will show what I've done and my various failed attempts in order to
> get this to work.
>
> So this is how I've done it so far:
>
> header:
> @interface MyCheckboxCellToo : NSTextFieldCell {
>    NSButtonCell *_checkboxCell;
> }

>
> implementation:

<snip>

You're missing an implementation of copyWithZone that copies the _checkboxCell ivar.

Hence, all use the same instance and show the same stuff. You'll also eventually get a crash because the default implementation of copyWithZone is just a bitwise copy of the class.

corbin

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Custom NSCell mouse events
      • From: Michael Hanna <email@hidden>
References: 
 >Custom NSCell mouse events (From: Michael Hanna <email@hidden>)

  • Prev by Date: Re: Notification when network volume disappears
  • Next by Date: Re: Notification when network volume disappears
  • Previous by thread: Custom NSCell mouse events
  • Next by thread: Re: Custom NSCell mouse events
  • Index(es):
    • Date
    • Thread