cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
hardner
Level VI

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

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.

7 REPLIES 7
David_Burnham
Super User (Alumni)

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

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.

 

Dave

-Dave
nikles
Level VI

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

Just wanted to ask if any new methods had been developed for doing this.  I too have the same issue (JMP Pro 14.3).

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

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 )
);
nikles
Level VI

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

This does not work for me.  Changing the dimensions from 500 to 100 does nothing.  Does it work for you?  

 

Using a mac, fwiw.

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

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.

jara95
Level III

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

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")
);
nikles
Level VI

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

User jara95's soln works for me.  User Craige_Hales also replied to me in another thread with a similar solution (thanks Craige):

https://community.jmp.com/t5/JMP-Wish-List/Set-Modal-Window-Position/idc-p/224498#M677

 

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.