load nib


I use a custom panel in several instances for my app.
The panel is contained in a nib file and my question is if there is a way to directelly get the window that’s loaded using the “load nib” command?

For example, after doing a loab nib:

load nib "ClosePanel"

I can get the window that just was loaded using the awake from nib handler.

on awake from nib theObject
    log (get name of theObject)    
end awake from nib

Examples use the following code:

load nib "ClosePanel"
set panelWIndow to window "close_panel"

but this won’t work since i have several windows named “close_panel” and this always gets me the first loaded panel and not the latest.


if you have several instances of the same class, you as the programmer are responsible to name or reference them properly.
For example you could create a record {theObject:theObject, theName:“myName”} and add an entry for each instance to a list.
Then you are able to identify the objects reliably.