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
Jackie_
Level VI

Preventing New Window from being maximized/resized?

Hello,

 

I want to prevent the new window from being maximized/resized. I am aware of the "<<Modal" window, but is there an alternate way? 

Found this threat but it runs a scheduler in the background which I don't prefer

https://community.jmp.com/t5/Discussions/How-to-stop-users-from-resizing-windows-in-JSL/td-p/15168

Jackie__0-1727098266586.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Preventing New Window from being maximized/resized?

No idea how that could be done.

 

But if you wish to provide very annoying user experience you can use graphic scripts

Names Default To Here(1);

nw = New Window("Example", <<size(200, 200),
	gb = Graph Box(
		Frame Size(1, 1)
	),
	box = V Splitter Box(
		Size(640, 480),
		H Splitter Box(
			Spacer Box(
				<<Set Fill(1);
				<<Color(RGB Color(9, 112, 84));
			),
			Spacer Box(
				<<Set Fill(1);
				<<Color(RGB Color(255, 222, 0));
			)
		),
		H Splitter Box(
			Spacer Box(
				<<Set Fill(1);
				<<Color(RGB Color(101, 153, 255));
			),
			Spacer Box(
				<<Set Fill(1);
				<<Color(RGB Color(255, 153, 0));
			)
		)
	)
);

(gb << Xpath("//AxisBox")) << visibility("Collapse");

Eval(EvalExpr(
	gb[FrameBox(1)] << Add Graphics Script(
		Expr(nw) << Zoom Window;
	);	
));

 

-Jarmo

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: Preventing New Window from being maximized/resized?

Look in the Scripting Index for Window Size

w = new window("test");
w << Set Window Size( 800, 1200 );
Jim
jthi
Super User

Re: Preventing New Window from being maximized/resized?

To my knowledge you cannot easily do this, but few questions:

  1. The most important question: why would you want to prevent user from resizing a window (doesn't really fit the feeling of JMP to not be able to resize a window).
    1. One window in JMP which prevents you from maximizing it and it is Legend window but you can still resize it so maybe there is a way to disable maximizing
    2. Other is Caption() but it is it's own thing
  2. If you wish to prevent resizing, why not use modal window?
  3. Is there a specific issue in using scheduler?
  4. That thread has the most probable answer: you might have to go outside the scripting language and do it from the operating system
-Jarmo
Jackie_
Level VI

Re: Preventing New Window from being maximized/resized?

@jthi 

  1. One window in JMP which prevents you from maximizing it and it is Legend window but you can still resize it so maybe there is a way to disable maximizing - I have never came across this, can you share an example code?
  1. If you wish to prevent resizing, why not use a modal window? - Bcos Modal window prevents accessing other files/tables 
  2. Is there a specific issue in using scheduler? The issue is it slows down the loop
jthi
Super User

Re: Preventing New Window from being maximized/resized?

No idea how that could be done.

 

But if you wish to provide very annoying user experience you can use graphic scripts

Names Default To Here(1);

nw = New Window("Example", <<size(200, 200),
	gb = Graph Box(
		Frame Size(1, 1)
	),
	box = V Splitter Box(
		Size(640, 480),
		H Splitter Box(
			Spacer Box(
				<<Set Fill(1);
				<<Color(RGB Color(9, 112, 84));
			),
			Spacer Box(
				<<Set Fill(1);
				<<Color(RGB Color(255, 222, 0));
			)
		),
		H Splitter Box(
			Spacer Box(
				<<Set Fill(1);
				<<Color(RGB Color(101, 153, 255));
			),
			Spacer Box(
				<<Set Fill(1);
				<<Color(RGB Color(255, 153, 0));
			)
		)
	)
);

(gb << Xpath("//AxisBox")) << visibility("Collapse");

Eval(EvalExpr(
	gb[FrameBox(1)] << Add Graphics Script(
		Expr(nw) << Zoom Window;
	);	
));

 

-Jarmo
Jackie_
Level VI

Re: Preventing New Window from being maximized/resized?

This is a nice hack. Thanks Jarmo