Re: Window title bar accessory view

2008-11-19 Thread Houdah - ML Pierre Bernard

Hi Andrew,

No I am not talking about the toolbar.

I am referring to the lock icon and the new green certificate  
information text displayed by Safari in the window's title bar.

iCal displays a pop-up menu where one can pick the time zone.

Pierre


On 19 Nov 2008, at 03:52, Andrew Merenbach wrote:


On Nov 18, 2008, at 6:26 PM, Houdah - ML Pierre Bernard wrote:


Hi!

I would like to replicate the accessory views found in the top  
right of window title bars. Examples include Coda, iCal, Safari,...


How can I add subviews to the window's title bar?

Pierre


Greetings, Pierre,

I think that what you're referring to is the toolbar (class  
NSToolbar), as I don't see anything besides that at the top of my  
iCal or Safari windows.  (On Leopard, the Unified Title/Toolbar  
setting in Interface Builder, or through code, makes the title bar,  
which is actually separate, look connected to the toolbar.)


If you can afford to target Leopard-only and are willing to put up  
with a slightly buggy interface, you can use Interface Builder to  
set up the toolbar in the window itself and store it in the nib or  
xib that way.  Otherwise, if for whatever reason that won't work for  
you*, you may wish to use a toolbar delegate to handle the  
configuration of the toolbar.  The docs have much more info, as well  
as dos and dont's of toolbars (for instance: anything in a  
toolbar, last I checked, should have a menu item equivalent; thus if  
you have a Reset button or a Send button or whatnot in your toolbar,  
there should be a Reset or Send menu item, accessible from the menu  
bar).  Hope this helps!


* Selectable toolbar items are one example of why the Interface  
Builder approach may no work for you -- such items are not currently  
configurable in IB.  (They're the sort of item used in the iTunes  
preferences window, where they act like push-buttons of which only  
one can be selected at a time.)


Cheers,
Andrew



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Window title bar accessory view

2008-11-19 Thread Houdah - ML Pierre Bernard

Hi Kyle!

Thanks a lot.

This sounds like a great idea. I will give it a try ASAP.

Pierre

On 19 Nov 2008, at 04:03, Kyle Sluder wrote:


On Tue, Nov 18, 2008 at 9:26 PM, Houdah - ML Pierre Bernard
[EMAIL PROTECTED] wrote:
I would like to replicate the accessory views found in the top  
right of

window title bars. Examples include Coda, iCal, Safari,...


Are you talking about things like the little lock icon in HTTPS Safari
windows?  If so, use -[NSWindow standardWindowButton:] to get an
NSButton instance, and then use -[NSView superview] to get at the
window frame view.  Then use -[NSView addSubview:] to add your custom
view and position it accordingly.

--Kyle Sluder


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Window title bar accessory view

2008-11-18 Thread Houdah - ML Pierre Bernard

Hi!

I would like to replicate the accessory views found in the top right  
of window title bars. Examples include Coda, iCal, Safari,...


How can I add subviews to the window's title bar?

Pierre
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Window title bar accessory view

2008-11-18 Thread Andrew Merenbach

On Nov 18, 2008, at 6:26 PM, Houdah - ML Pierre Bernard wrote:


Hi!

I would like to replicate the accessory views found in the top right  
of window title bars. Examples include Coda, iCal, Safari,...


How can I add subviews to the window's title bar?

Pierre


Greetings, Pierre,

I think that what you're referring to is the toolbar (class  
NSToolbar), as I don't see anything besides that at the top of my iCal  
or Safari windows.  (On Leopard, the Unified Title/Toolbar setting in  
Interface Builder, or through code, makes the title bar, which is  
actually separate, look connected to the toolbar.)


If you can afford to target Leopard-only and are willing to put up  
with a slightly buggy interface, you can use Interface Builder to set  
up the toolbar in the window itself and store it in the nib or xib  
that way.  Otherwise, if for whatever reason that won't work for you*,  
you may wish to use a toolbar delegate to handle the configuration of  
the toolbar.  The docs have much more info, as well as dos and  
dont's of toolbars (for instance: anything in a toolbar, last I  
checked, should have a menu item equivalent; thus if you have a Reset  
button or a Send button or whatnot in your toolbar, there should be a  
Reset or Send menu item, accessible from the menu bar).  Hope this  
helps!


* Selectable toolbar items are one example of why the Interface  
Builder approach may no work for you -- such items are not currently  
configurable in IB.  (They're the sort of item used in the iTunes  
preferences window, where they act like push-buttons of which only one  
can be selected at a time.)


Cheers,
Andrew



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Window title bar accessory view

2008-11-18 Thread Kyle Sluder
On Tue, Nov 18, 2008 at 9:26 PM, Houdah - ML Pierre Bernard
[EMAIL PROTECTED] wrote:
 I would like to replicate the accessory views found in the top right of
 window title bars. Examples include Coda, iCal, Safari,...

Are you talking about things like the little lock icon in HTTPS Safari
windows?  If so, use -[NSWindow standardWindowButton:] to get an
NSButton instance, and then use -[NSView superview] to get at the
window frame view.  Then use -[NSView addSubview:] to add your custom
view and position it accordingly.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]