New topic: 

Passing data to a window

<http://forums.realsoftware.com/viewtopic.php?t=45951>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        software-maniac          Post subject: Passing data to a 
windowPosted: Fri Nov 16, 2012 3:35 pm                         
Joined: Sun Apr 29, 2007 11:26 am
Posts: 26
Location: Seattle, WA                The example project called DialogsExample 
is quite good and simple. When a dialog box has self-contained data like a list 
of names to choose from you can pre-populate it at form design time. However, 
in most cases, an app will want to "pass" data to the dialog. Examples would be 
a list of names from a database, a standard window background color, or even 
replacement text for UI controls. It seems like in between the New dialog 
instantiation and the ShowModal method call, any properties in the window you 
want to set (like a default listbox index) is lost to the default:

  Dim dialog As New DialogWindow
dialog.intListIndex = 1 ' My property that refers to a listbox
dialog.ShowModal
WindowDialogResultLabel.Text = dialog.SelectedName


Does anyone have examples or best practices advice?

Also you'd want to retrieve some of the data after the dialog box window closes 
("returns") and it appears that as long as the dialog object is still 
instantiated, you can still retrieve exposed properties. (I would rather use 
setter and getter methods to load up dialog data and to unload data, but it may 
be my imagination but if after you Self.Close a dialog (pressing the OK button, 
for example), any method call (even your own) that you call will automatically 
redisplay the dialog window again.

thanks for any advice!
Ken   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to