Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar

Set Modal Window Position

It would be nice to have a method of setting the position of a Modal Window.  Currently, window position must be set after creating the window.  But since a Modal window halts all processing, the command to reposition the window is not seen until after the window is closed.  

 

I envision something like this:

 

w = New Window("My Window", 
<< Modal,
<< Position(100, 100), Text Box("I'm a window!") );

 

Credit to In JSL, can I tell a modal window where to be? 

Tracking Number:

Defect ID: S1559593

2 Comments
Staff (Retired)

That would make it simpler. Currently you can do it like this:

w = New Window( "My Window", 
	<<Modal, 
	<<OnOpen( Window( "My Window" ) << moveWindow( 100, 100 ) ), 
	Text Box( "I'm a window!" ) 
);

The OnOpen script runs before the variable w is assigned, and before the window becomes current, but the window does exist so the window function can find it by name.

Level V

Thanks Craig!  This works for me.  It would still be great to have a simpler method in future revs, but this is a pretty good alt.

 

Will post your soln to the previous discussion thread in case others don't see it here.