• 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: advice for creating these controls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: advice for creating these controls


  • Subject: Re: advice for creating these controls
  • From: Lee Ann Rucker <email@hidden>
  • Date: Fri, 23 Mar 2012 11:44:53 -0700

On Mar 23, 2012, at 3:24 AM, Rick C. wrote:

> This is what I would expect too.  But drawSegment:inFrame:withView: doesn't override the cell drawing from what I know am I missing something?

That draws the cell content, not the border or separator. To change that, subclass drawWithFrame:inView: and draw it there, then call drawInteriorWithFrame:inView: yourself - don't call super. The actual border drawing is done by a non-public method. You'll also need to draw the focus ring around the keySegment yourself.

(Why yes, I have a custom NSSegmentedControl :) )

>
>
>
> On Mar 23, 2012, at 2:19 PM, Seth Willits wrote:
>
>> On Mar 22, 2012, at 9:49 PM, Lee Ann Rucker wrote:
>>
>>> The button/popup combo could still be an NSSegmentedControl. Getting a menu on a segment is just a matter of setMenu:forSegment: - the triangle would have to be part of the icon, because it doesn't do it for you.
>>
>> You're totally right. I had forgotten about that.
>>
>>
>>
>> On Mar 22, 2012, at 9:50 PM, Rick C. wrote:
>>
>>> Thanks everyone for the replies.  Yes I guess I just need to get a bit better at subclassing to get the right look. :-)  To be sure I would subclass NSSegmentedControl not NSSegmentedCell right?
>>
>> It's NSSegmentedCell that does the drawing for the control. Same goes for all of the other controls - their cells do the drawing.
>>
>>
>> --
>> Seth Willits
>>
>>
>>
>>
>> _______________________________________________
>>
>> 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
>
>
> _______________________________________________
>
> 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


_______________________________________________

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: advice for creating these controls
      • From: "Rick C." <email@hidden>
References: 
 >Re: advice for creating these controls (From: Lee Ann Rucker <email@hidden>)
 >Re: advice for creating these controls (From: Seth Willits <email@hidden>)
 >Re: advice for creating these controls (From: "Rick C." <email@hidden>)

  • Prev by Date: Re: advice for creating these controls
  • Next by Date: Re: NSDateFormatter not working on iOS 5.
  • Previous by thread: Re: advice for creating these controls
  • Next by thread: Re: advice for creating these controls
  • Index(es):
    • Date
    • Thread