0

I have one window in a Cocoa-Document based application. I want to make this application have no titlebar. I know how to do this in a regular Cocoa app because there is a window called "window" in Cocoa-Document based apps I don't see any window declarations. So my question is how to I make a borderless window in a Cocoa Document_based app? Thanks

foobar5512
  • 2,470
  • 5
  • 36
  • 52

2 Answers2

1

Look in the document's nib file. In a document-based application, this is often called "MyDocument.xib". You can get rid of the old window and replace it with the type you prefer. Just remember to connected it to the appropriate outlet in File's Owner.

Caleb
  • 124,013
  • 19
  • 183
  • 272
  • Yeah -- This. Read the docs I pointed to, but this is the right answer. :) – bbum Mar 20 '11 at 20:54
  • I agree -- absolutely read those docs. It's one thing to change the window type, but to work that change into an application that makes sense will require changes to the document, too. You'll need an understanding of the document architecture. – Caleb Mar 20 '11 at 21:35
0

An NSDocument [subclass] has an NSWindowController between the document and the document's window. Typically, you'd subclass in NSWindowController to, say, create a document that has multiple windows.

In this case, you'll likely subclass NSWindowController to customize the creation of your window. Or you could subclass NSWindow and have your document use your subclass instead of the generic NSWindow.

See the Document-Based Application guide. The FAQ contains overview information on subclassing and the role of NSWindowController.

elp
  • 8,021
  • 7
  • 61
  • 120
bbum
  • 162,346
  • 23
  • 271
  • 359