Re: makeWindowControllers
Re: makeWindowControllers
- Subject: Re: makeWindowControllers
- From: Brent Gulanowski <email@hidden>
- Date: Wed, 2 Jul 2003 22:49:14 -0400
On Wednesday, July 2, 2003, at 07:07 PM, mmalcolm crawford wrote:
On Wednesday, July 2, 2003, at 03:23 PM, Brent Gulanowski wrote:
I see what you're saying, but I had -createTextures as a private
method, to signify that it was not supposed to be called at any time
other than when the document is created. If I expose it, what is a
good way to make it clear that the method is not for general use? In
the interests of maintainability.
Implement and call a public "setUpDocument" method which in turn calls
createTextures? :-)
Well, it's one of those things -- where does it get called? I'm trying
to understand a lot of the background work in the document architecture
so that I can do things in a way that makes _intuitive_ sense, if
that's possible. Generally, though, I just have to worry about doing it
in the correct order, which is not immediately apparent from any
documentation or discussions I've been reading (I've got three books!).
It's great to have such a full-featured architecture, but it's not
always clear where the hooks are to add in your own stuff in a
"standard" way, if there is such a thing. I've got it all working, so
it's no big deal.
I'd prefer to create the textures earlier, except that the view and
its OpenGLContext must exist first (or crashola), and that won't
happen until after the Nib is loaded.
Ah, OK, that makes things clearer, however
For now, I'm just invoking -createTextures from
-makeWindowControllers (after calling [mainWindowController window]
to force nib loading). I don't like it, so a better solution that is
cleaning and more in keeping with the document architecture would be
desired. There are simply some places where OpenGL and Cocoa don't
mesh seamlessly, so far.
now I'm less clear. I'm not sure why you don't like invoking
createTextures from makeWindowControllers? The document must create a
window at some stage... I suspect I'm missing something?
Hmm, no, it's fine, but I'm not strictly making a window controller! If
you were to look at the NSDocument methods and say, "where should I do
this task" for your custom document-based app (and the fact is, mine is
atypical, being as documents are dependent on support data files --
that's weirder than using OpenGL), it doesn't always jump out at you.
:-) But yeah, it works just fine, and the document class has
off-loading as much as possible to window controllers, special view
controllers and delegates/data sources, so it's not that cluttered.
It's an aesthetic issue more than anything.
Thanks for your help,
Brent Gulanowski
--
Ten thousand years ago, the state of the art was a goat. -- Cory
Doctorow
_______________________________________________
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.