cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Jackie_
Level VI

Bring window to front

Hi @txnelson 

I am trying to bring the variability chart window in the front or maximize it after clicking on button box "Plot". I tried using bring window to front but it's not working. Can you suggest what other syntax can be use?

 

Here's my script: 

Names Default To Here( 1 );
dt2 = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = New Window( "New window",
	<<modal(),
	Text Box(
		"Tests", 
			
		<<Set Font Style( "Bold" ),
		<<Set Wrap( 1000 )
	), 
	
	Spacer Box( Size( 20, 20 ) ), 
               
	H List Box(
		Panel Box( "Input JMP file",
			Button Box( "Select file",
				dt_path = Pick File( "Select JMP File", "", {"JMP Files|jmp"} );
				If( !Is Missing( dt_path ),
					dt1 = Open( dt_path, invisible )
				);,
				<<setIcon( "ListItemAdd" )
			) 
		)
	),
	V List Box(
		aa = Panel Box( "Variablity chart",
			Button Box( "   Plot   ",
				vc = dt2 << Variability Chart(
					Y( :height ),
					X( :sex ),
					Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
					Show Range Bars( 0 ),
					Std Dev Chart( 0 ),
					Points Jittered( 1 )
				);
				aa << close window;
				vc << Bring window to front; ////////// Not working?
						
						
			,
				<<setIcon( "VariChart" )	
									
									
			)
		)
									
									
									
	)
,
	Spacer Box( Size( 20, 10 ) ),
	Panel Box( "Actions", 

		H List Box(
			align( center ), 

			Button Box( "OK",
				keep_going = 1;
				todo_list = my_cb << get selected;,
				<<setIcon( "CheckCircle" )
			), 

			Button Box( "Cancel", keep_going = 0, <<setIcon( "ErrorSmall" ) )

		), 

	),
	<<Size Window( 340, 430 )
);
1 ACCEPTED SOLUTION

Accepted Solutions
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Bring window to front

I think this has to do with 1) the modal window, nw, always being in focus so the vc window can't come to the front, and 2) the modal window not closing until the whole button box script is complete, despite your close window message.  You could try putting that code in the on close script of that window and creating the vc variable in the here namespace so the on close script can access it after the nw window is gone:

Names Default To Here( 1 );
dt2 = Open( "$SAMPLE_DATA/Big Class.jmp" );
vc = {}; //create variable here so on close script can access it
nw = New Window( "New window",
	<<modal(),
	<<Size Window( 340, 430 ),
	<< On Close(try(vc << bring window to front)),
	bb = Button Box( "Plot",
		vc = dt2 << Variability Chart(
			Y( :height ), X( :sex ),
			Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
			Show Range Bars( 0 ), Std Dev Chart( 0 ), Points Jittered( 1 )
		);
		bb << close window;
	)
);

 

View solution in original post

2 REPLIES 2
mikedriscoll
Level VI

Re: Bring window to front

You're close.  It's the new window nw that you want to ring to the front, not the variability plot object within it.  Try nw << bring window to front(). If that doesn't work, add a 'wait(0);' before it.

 

Sorry, didn't realize you had a modal window. 

ih
Super User (Alumni) ih
Super User (Alumni)

Re: Bring window to front

I think this has to do with 1) the modal window, nw, always being in focus so the vc window can't come to the front, and 2) the modal window not closing until the whole button box script is complete, despite your close window message.  You could try putting that code in the on close script of that window and creating the vc variable in the here namespace so the on close script can access it after the nw window is gone:

Names Default To Here( 1 );
dt2 = Open( "$SAMPLE_DATA/Big Class.jmp" );
vc = {}; //create variable here so on close script can access it
nw = New Window( "New window",
	<<modal(),
	<<Size Window( 340, 430 ),
	<< On Close(try(vc << bring window to front)),
	bb = Button Box( "Plot",
		vc = dt2 << Variability Chart(
			Y( :height ), X( :sex ),
			Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
			Show Range Bars( 0 ), Std Dev Chart( 0 ), Points Jittered( 1 )
		);
		bb << close window;
	)
);