Re: [newbie alert] only one document open at any time
Re: [newbie alert] only one document open at any time
- Subject: Re: [newbie alert] only one document open at any time
- From: jerome LAURENS <email@hidden>
- Date: Tue, 4 Jun 2002 12:29:33 +0200
Le mardi 4 juin 2002, ` 09:20 AM, Markus Ruggiero a icrit :
Hi Folks,
I am slowly starting with Cocoa programming. The more I do the more I
like it. Now I need some help. I want to make a small application that
displays a picture in a window. I have done the ImageApp tutorial from
oreillynet (?). This app opens one window per file. How would I go if I
wanted only one window at any given time? So opening another file would
then simply reuse the same window. Is this a document based app at all?
Or should I go with a non document app instead? And then what would I
have to do to make dropping files onto the app's icon possible?
Your app can be document based, you can
create a shared window controller that will control the window of your
app. This window might contain an NSTabView.
In the NSDocument "windowControllerDidLoadNib", add your "content view"
to the shared window controller's tab view above (create a new tab view
item, fix the size of the view/window set its view to your content)
in the document nib, you can just put the window "content view" in a
custom view, not the window itself and connect the view to one outlet
(create one if necessary, don't forget to retain the view)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.