Kyle,

Thanks for the reply.

On Sep 18, 2008, at 12:08 am, Kyle Sluder wrote:

On Wed, Sep 17, 2008 at 3:04 PM, Nick Beadman <[EMAIL PROTECTED]> wrote:

The issue I am having is that I want my NSPanel to have the title bar on the (left) side. In Carbon there is an WindowAttribute (kWindowSideTitlebarAttribute) which makes this trivial but I can't find anything equivalent in Cocoa.

Hrm. Unless your window looks like the Formula bar in Excel, perhaps this isn't the best idea. But whatever, we'll roll with it. In any case, file an enhancement request at http://bugreport.apple.com and see if Apple gives word on this feature.

Will do, just thought I would ask to see if was a common request with a well established solution. In my (limited) experience, Apple doesn't really communicate too much on feature request (not saying they take no notice, just they don't communicate much, if at all).

As for it not being the best idea, I think that is more of a value judgement but the reason I am pursuing it is because screens are wider than they are tall so putting the title bar on the side uses (much) less screen real estate. In fact I would like to see many more vertical controls (e.g. NSSegmentedControl) but this is also probably another feature request.

Searching found an item on cocodev <http://www.cocoadev.com/index.pl?TitlebarOnSide > which suggests that this isn't possible and suggests subclassing NSWindow using NSBorderlessWindowMask which directed me to the "RoundTransparentWindow" sample. Of course, the issue with this is that the entire title bar, all of the close/minimize/maximize buttons and resize box have to be custom controls which is not an insignificant amount of work.

Psst... +[NSWindow standardWindowButton:].  :)

What an interesting class method! Makes me think Cocoa has at least thought about this, maybe I should go whole hog and ask for a "theme manager" so the graphics for building standard controls are easily available :-).

More searching suggested that the controls in the window created by Carbon and initWithWindowRef: would have to be Carbon controls even though it would be much easier in this case that they be Cocoa. The solution in Leopard appears to be HICocoaView but that isn't an option for me as the application has to run on Tiger (10.4) too.

You should be creating your controls in the nib. Though this does present an interesting question of whether it's possible to provide the desired mask using a Carbon nib.


I am creating my controls in a nib. HICocoaView allows you to embed an entire NSView hierarchy and when I was experimenting I simple moved all of my views that were embedded in a NSPanel and moved them to an NSView and then embedded (using code) that into the HICocoaView after getting it from a nib.

Interface Builder does have "Side Title" checkbox in the Appearance section of the window attributes inspector when working on Carbon window. IB2 is slightly more intelligent in that it knows it should only be enabled for certain window types (e.g. utility windows).

I would still be interested in sample code showing a sub-class of NSWindow or NSPanel....
Nick

--
Nick Beadman
[EMAIL PROTECTED]
(sent from my mailing list account, [EMAIL PROTECTED])

_______________________________________________

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]

Reply via email to