• 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
Re: How to Make a Very Thin Window? - Solved
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Make a Very Thin Window? - Solved


  • Subject: Re: How to Make a Very Thin Window? - Solved
  • From: Steve Cronin <email@hidden>
  • Date: Wed, 5 Dec 2007 10:52:47 -0600

Shawn;

Hey thanks for the comments!

Couple of questions:
What do you mean that the order is not important?
How would I do a -initWithWindow if the window doesn't exist?
Do you mean to create it with some placeholder window and then later do a -setWindow?


What do you mean "...can have the file owner wired up with those objects..?
Who is the fileOwner? What objects are you referring to?
By "wired up" do you mean set as outlets or something different?


What do you mean "...You could even have that nib owner do the construction of you border-less window when the nib is loaded.."
When is the nib loaded? by who?
Something like??
[[NSBundle mainBundle] loadNibNamed:@"MyNib" owner:myWindowController];
What method would do the window creation?


Best Regards,
Steve




On Dec 5, 2007, at 10:29 AM, Shawn Erickson wrote:

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


References: 
 >How to Make a Very Thin Window? (From: Steve Cronin <email@hidden>)
 >Re: How to Make a Very Thin Window? (From: Dominik Pich <email@hidden>)
 >Re: How to Make a Very Thin Window? (From: Steve Cronin <email@hidden>)
 >Re: How to Make a Very Thin Window? (From: Dominik Pich <email@hidden>)
 >Re: How to Make a Very Thin Window? - Solved (From: Steve Cronin <email@hidden>)
 >Re: How to Make a Very Thin Window? - Solved (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: How to Make a Very Thin Window? - Solved
  • Next by Date: Re: CATextLayer and CAConstraint: an autoresizing height LayoutManager
  • Previous by thread: Re: How to Make a Very Thin Window? - Solved
  • Next by thread: Problem while taking the Low-level Core Data Tutorial
  • Index(es):
    • Date
    • Thread