• 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: [Q] Hiding zoom & minimize buttons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] Hiding zoom & minimize buttons


  • Subject: Re: [Q] Hiding zoom & minimize buttons
  • From: "Michael Ash" <email@hidden>
  • Date: Wed, 22 Oct 2008 10:53:38 -0400

On Wed, Oct 22, 2008 at 10:36 AM, Eric Gorr <email@hidden> wrote:
> I found this old thread:
>
> http://lists.apple.com/archives/cocoa-dev/2006/Mar/msg01864.html
>
> and I would like to know the same thing. Unfortunately, the old thread did
> not conclude with an answer.
>
> While it is possible to obtain the button by doing:
>
> NSButton *miniaturizeButton = [myWindow
> standardWindowButton:NSWindowMiniaturizeButton];
> [miniaturizeButton removeFromSuperview];
>
> this results in a crash.

First, I highly recommend against doing this. If Cocoa keeps them
present but disabled then you ought to stick with that

Your crash is happening because the window is trying to manipulate the
button, but you have caused it to be deallocated when you removed it
from its superview. Retain the button before you remove it, and of
course keep a reference to it so that you can release it at the
appropriate time, and this should prevent the crash. You may be able
to simply hide it using the -setHidden: method.

Mike
_______________________________________________

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: [Q] Hiding zoom & minimize buttons
      • From: Eric Gorr <email@hidden>
References: 
 >[Q] Hiding zoom & minimize buttons (From: Eric Gorr <email@hidden>)

  • Prev by Date: CALayer graphics context
  • Next by Date: Re: NSInMemoryStoreType: Not really "persistent", is it?
  • Previous by thread: [Q] Hiding zoom & minimize buttons
  • Next by thread: Re: [Q] Hiding zoom & minimize buttons
  • Index(es):
    • Date
    • Thread