Skip navigation.
 
mlRe: best time to alter GUIs
FROM : Daniel Child
DATE : Mon Mar 03 18:12:29 2008

On Mar 1, 2008, at 6:15 AM, Ken Thomases wrote:

> Does your init method do anything else other than calling [super 
> initWithWindowNibName:]?  In particular, if it calls [self window], 
> that forces the loading (and awakening) of the NIB in order to 
> reconstitute the window.

My bad. I should have checked that, and assumed it simply passed the 
address. If [self window] loads things, is there any way to obtain 
the window's address without loading it? I found it useful to assign 
a (superfluous) instance variable since I was doing so much with the 
window. I didn't want to have to use [self window] each time, 
especially if [self window] actually tries to load each time.

> Perhaps the proper thing to do is pass the extra data into the init 
> method of your custom controller class.

I've opted for a different approach: simply redraw the window after 
passing the data that determines window parameters. Maybe not the 
most elegant solution, however.... I'm still wondering how you can 
access the window's address without loading it.

> On a related note, where's the model in the MVC design?  Are the 
> values with which you're configuring the controller (and 
> subsequently the window) things which should be coming from the 
> model?  Maybe the controller needs to be initialized with a 
> relationship to a model, and then it will get what it needs from 
> that model.

Oh, I didn't mention it. The master controller determines which 
window controller (and process step) to load, but each individual 
controller is in fact associated with model stuff that I didn't even 
mention. The "local data" is simply critical data that needs to be 
passed from one part of the model to another. Doing this lets me keep 
each step self-contained, and avoids a bunch of code nesting.

> Another thing to consider: the above code looks as though it's 
> designed to be run through multiple times.  Note, though, that the 
> controller will only load the window once during its lifetime.  So, 
> what do you hope [fieldIDController setLocalDataCopy: [self 
> dataValues]]; will accomplish on subsequent passes through that code?

If I make a mistake entering values at a certain step, I can redo 
that step by hitting the appropriate button in the master controller. 
At that point, the step's windowController will already exist.

Thanks for the comments.... For what it's worth, I've got the thing 
to run properly. Defining the segments within frames, and adding them 
(as a subview) to the window view was the critical missing step.

Related mailsAuthorDate
mlbest time to alter GUIs Daniel Child Feb 29, 06:04
mlRe: best time to alter GUIs Quincey Morris Feb 29, 09:04
mlRe: best time to alter GUIs Ken Thomases Mar 1, 12:15
mlRe: best time to alter GUIs Daniel Child Mar 3, 18:12
mlRe: best time to alter GUIs Ken Thomases Mar 3, 20:05
mlRe: best time to alter GUIs Quincey Morris Mar 3, 20:05
mlRe: best time to alter GUIs Daniel Child Mar 8, 04:38
mlRe: best time to alter GUIs Ken Thomases Mar 8, 07:11
mlRe: best time to alter GUIs Daniel Child Mar 12, 16:45
mlRe: best time to alter GUIs Ken Thomases Mar 13, 00:54