For an ordinary window I can do this...
nw = New Window( "test window", Text Box( "just trying out this window" ) ); nw << move window( 100, 500 );
But for a modal window that doesn't work - I get that, the window is busy waiting for inputs so doesn't get any message sent afterwards.
I tried sending this message when creating the window. But if I do it after the <<modal message it doesn't work (maybe for same reason?)
But this doesn't work either...
update = New Window( "Update stuff in this window", <<movewindow( 100, 500 ), <<modal, Text Box( "blah blah" ), Text Box( " " ), Text Box( "value:" ), ubox2 = Number Edit Box( 42, 5 ), Text Box( " " ), Button Box( "OK" ) );
With that it does move the window (and oddly reshape it) but the <<modal message does not work.
This is in JMP11. Thanks for any inputs.
It is possible to send messages to a modal window by using the OnOpen message
nw = New Window( "test", <<Modal, <<On Open( tb << Set Text( "Demo" ) ), tb = Text Box( "" ) );
However, I don't think the window responds to the Move Window message.
Just wanted to ask if any new methods had been developed for doing this. I too have the same issue (JMP Pro 14.3).
Here is a way:
Names Default to Here( 1 ); New Window( "Move It!", << Modal, Text Box( "Here I am, right here!" ), << Move Window( 500, 500 ) );
This does not work for me. Changing the dimensions from 500 to 100 does nothing. Does it work for you?
Using a mac, fwiw.
I am using Mac, too. What version of JMP are you using? This code has worked for a few versions, but I cannot remember exactly when it was introduced.
The arguments (500, 500) in the Move Window message define the (X, Y) location of the upper left corner of the window in screen pixels.
Here is alternative way,
update=New window("Update stuff in this window", <<modal, <<on open(btn<<click(1);btn<<delete), btn=buttonbox("",btn<<movewindow(100,500)), textbox("blah blah"), textbox(" "), textbox("value:"), ubox2=numbereditbox(42,5), textbox(" "), buttonbox("OK") );
User jara95's soln works for me. User Craige_Hales also replied to me in another thread with a similar solution (thanks Craige):
w = New Window( "My Window", <<Modal, <<OnOpen( Window( "My Window" ) << moveWindow( 500, 500 ) ), Text Box( "I'm a window!" ) );
Confirmed that changing the coords actually updates the location of the window on my computer (Mac, JMP Pro 14.3). Thanks all.
There are no labels assigned to this post.