• 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
How do I make a flexible NSToolbarItem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I make a flexible NSToolbarItem?


  • Subject: How do I make a flexible NSToolbarItem?
  • From: PGM <email@hidden>
  • Date: Thu, 7 Sep 2006 10:49:54 -0400

Hi everybody

My app has a toolbar in which I would like to have a view with a searchbox that stretches automatically, like the one SearchBoxes in most Apple apps. The documentation says about sizing NSToolbarItem:

"If a view item’s view does something intelligent when it is stretched, then you will set its maxSize greater than its minSize in height, width, or both. Horizontally-stretchable view items, including the Flexible Space standard item, compete equally for available horizontal space."

The question now rises: how do I make my view do "something intelligent"?

In Interface Builder, I have set my view to be flexible. And I have implemented NSToolbar's toolbarWillAddItem: to set the maxSize.width of my view to 2000 and the minSize.width to 51. However, my searchbox and an adjacent NSToolbarFlexibleSpaceItem do NOT compete equally for space; my searchbox is huge and the flexibleSpace is tiny. Furthermore, when I customise my toolbar, the customisation sheet shows the searchBox is the same huge size as it is in the toolbar and not in the small size that you see for the searchbox when you customise a toolbar in an Apple app. Has anybody succeeded in getting this to work as it should? Serachboxes are becoming increasingly popular, so I would guess that people have struggled with this before.

Thanks in advance, Patrick _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How do I make a flexible NSToolbarItem?
      • From: "I. Savant" <email@hidden>
  • Prev by Date: [Moderator] EOT (Re: Adding silence in audio file)
  • Next by Date: Re: Objc - Exceptions
  • Previous by thread: Re: Re: Objc - Exceptions
  • Next by thread: Re: How do I make a flexible NSToolbarItem?
  • Index(es):
    • Date
    • Thread