• 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: Toolbar hide/show button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toolbar hide/show button


  • Subject: Re: Toolbar hide/show button
  • From: Ryan Stevens <email@hidden>
  • Date: Tue, 11 Mar 2003 08:38:17 -0800

It is possible to remove the pill button. Of course, there's no
"supported" way to do it and in your case it's probably not a good idea
but it can be done with a little hacking...

I used the toolbar button to open/close a drawer and changed its
appearance, for instance.

How'd I do that?...

Subclass NSControl. Use poseAsClass: to replace NSControl with your
sublcass.

Here's (roughly) what I did...

BOOL isPill;
BOOL doneOnce;

- (void)drawRect:(NSRect)aRect
{
if (!doneOnce) {
if ([[self className] isEqualToString:@"_NSThemeWidget"] &&
[NSStringFromSelector([self action])
isEqualToString:@"_toolbarPillButtonClicked:"]) isPill = YES;

doneOnce = YES;
}

if (isPill) { /*do special drawing*/ return; }

[super drawRect:aRect];
}

On Tuesday, March 11, 2003, at 06:36 AM, Peter Karlsson wrote:

> But how do I make a toolbar myself if it's not possible to remove the
> hide/show button?
>
> Peter
>
>> From: Seth Willits <email@hidden>
>> To: "Peter Karlsson" <email@hidden>
>> CC: email@hidden
>> Subject: Re: Toolbar hide/show button
>> Date: Tue, 11 Mar 2003 06:27:30 -0800
>>
>> On Tuesday, March 11, 2003, at 01:08 AM, Peter Karlsson wrote:
>>
>>> Is it even possible to do?
>>
>> Not that I know of. It is in Carbon, so maybe you could make a Carbon
>> call to remove it, although I highly recommend that you don't.
>>
>>
>> Seth Willits
>> ----------------------------------------------------------------------
>> -- ---
>> President and Head Developer of Freak Software -
>> http://www.freaksw.com
>> Q&A Columnist for REALbasic Developer Magazine -
>> http://www.rbdeveloper.com
>>
>> "In the eyes of others, spending a lifetime chasing a dream is often
>> seen
>> as a lavish waste of a one-time gift. But maybe the joy isn't in its
>> catching, but rather in its pursuit."
>> -- Seth Willits
>> ----------------------------------------------------------------------
>> -- ---
>>
>>
>
> _________________________________________________________________
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
> _______________________________________________
> 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.
_______________________________________________
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.

References: 
 >Re: Toolbar hide/show button (From: "Peter Karlsson" <email@hidden>)

  • Prev by Date: Re: Programmatically taking a screenshot
  • Next by Date: NSForm as 2 columns
  • Previous by thread: Re: Toolbar hide/show button
  • Next by thread: Re: Toolbar hide/show button
  • Index(es):
    • Date
    • Thread