Toolbar View Item Size
Toolbar View Item Size
- Subject: Toolbar View Item Size
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Mon, 15 Dec 2008 14:39:06 +0700
Toolbar Programming Topics for Cocoa -> Setting a Toolbar Item’s Size
says about view items:
"The minSize and maxSize toolbar must not be left unset (or the view
will not display), and unless you are implementing intelligent
stretching behavior in a view item, both theminSize and maxSize
properties should equal the size of the item’s view."
My toolbar has NSButtons as views. And I would like to have small (or
mini) sized buttons, when "Use Small Size" is selected and regular
sized buttons otherwise.
But toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: is only
called once. It is not called again, when the "Use Small Size"-flag
changes.
So how can I implement "intelligent stretching behavior" to get
appropriate sized buttons?
Another, slightly related problem:
[ myButton setBezelStyle: NSTexturedRoundedBezelStyle ];
[ myButton setTitle: name ];
//[ myButton setFont: [ NSFont controlContentFontOfSize: 0.0 ] ]; //
12 pt.; default
//[ myButton setFont: [ NSFont labelFontOfSize: 0.0 ] ]; // 10 pt.
[ myButton sizeToFit ];
always returns a button-height of 25 (the width varies with the font
used).
Is this the correct and expected behaviour?
Kind regards,
Gerriet.
_______________________________________________
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