Re: How to Make a Very Thin Window? - Solved
Re: How to Make a Very Thin Window? - Solved
- Subject: Re: How to Make a Very Thin Window? - Solved
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 5 Dec 2007 08:29:03 -0800
On Dec 5, 2007 6:46 AM, Steve Cronin <email@hidden> wrote:
> Folks;
>
> For the record I thought I would submit what I did to get this to work.
>
> There was a menu item, in MainMenu, which would invoke both the
> windowController's -initWithNib and -showWindow.
> The nib referenced here was a second nib - NOT - 'MainMenu'.
> The windowController was set as this second nib's fileOwner and the
> windowController's -window was an outlet hooked up in IB in this 2nd
> nib.
> The window was fully created in IB in the 2nd nib.
>
> The way I solved the problem was to first create the window
> programmatically and then utilize the windowController's -
> initWithWindow method.
> I have to implement all the dragging and resizing code for the window
> because the NSBorderlessWindow mask does not create any UI widgets.
> (NOTE the NSWindow class' method -setShowResizeIndicator is
> apparently just ignored)
Border-less windows are special and the framework provides limited
support for them.
> In order to do this the window has to be created before the
> windowController's -initWithWindow.
> So neither the window itself, nor the windowController, are involved
> in the 2 nib mentioned above.
Since you are subclassing NSWindowController you could do just about
anything you want (you don't even need to use a window controller
depending on your needs). The order restrictions you are implying
above are not set in stone in other words.
> Now that I am creating both window and windowController in the menu
> action in MainMenu I have to migrate all the UI widgets into a view
> in MainMenu.
> In fact, it appears, the 2nd Nib is no longer useful as such. So I
> must migrate all of its objects to MainMenu. (Arrgh!)
> This new view is set as the contentView for the programatiically
> created window.
That second nib is still useful since you can choose to load it only
when you need the view items it contains. In fact you can have the
file owner wired up with those objects and simply move swap the
content view into your custom window. You could even have that nibs
owner do the construction of you border-less window when the nib is
loaded.
-Shawn
_______________________________________________
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