realbasic-nug
[Top] [All Lists]

Re: Passing data to a form.

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Passing data to a form.
From: Charles Yeomans <yeomans at desuetude dot com>
Date: Tue, 30 Nov 2004 15:30:46 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <200411302004 dot iAUK4umm022881 at mac dot com>

On Nov 30, 2004, at 3:06 PM, Steve Smith wrote:

I'm trying to set a property in a form that I'm calling. In the VB world, I'm used to using the TAG property for this, so I set a public property in
window1 with the name gTag and then using the following code.

dim w as new window1
w.gTag = "Title"
w.show

However, it appears that the dim w as new window is firing the open sub in window1. I expected the w.show to fire it. As a result, the gTag property
isn't set when the open sub is run.

Correct; the Open event handler is called by the Window constructor.


What's the best way to pass a string (or anything else) to a form?

It depends. If it's a value that the window must have in order to function, then it should probably be passed in a constructor. Otherwise, it depends :)

--------------
Charles Yeomans

_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>