On Mar 14, 2006, at 1:10 PM, Giuseppe Farese wrote:

As far as I know, "Self" inside any window's method or event refers to the windows itself. I'll be in trouble to use 'Window1' instead of 'Self' if multiple instances of Window1 are open.

Giuseppe,

Your code opening window2 does not exist within the window, it exists within the container control and because of this "Self" is the container control.

If you want proof of this, put a breakpoint on that line and then look at self in the debugger. You will set that it is showing the container control name, not the window name. Now click on "Self" in the debugger and you will see that one of its properties is "Window".

If you search the NUG digest you will find places where this is discussed. In fact here is one of them:

Now, if you have a control *subclass* and you've got code in the class definition for that control -- code that's not embedded in the window where a particular control instance is created, but associated with all controls of that class -- then Self is the control (and is synonymous to Me). But in that case, you can use the handy .Window property of the RectControl class to get to the parent window.

Here is how you can code it so that it works and allows you to have multiple window1 windows open with no trouble.

w2.ShowModalWithin self.window



=== A Mac addict in Tennessee ===

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to