cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
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? 

2 Comments
Craige_Hales
Super User

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.

nikles
Level VI

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.