cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-801318%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3EPreventing%20New%20Window%20from%20being%20maximized%2Fresized%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-801318%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%3CSPAN%3EHello%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20want%20to%20prevent%20the%20new%20window%20from%20being%20maximized%2Fresized.%20I%20am%20aware%20of%20the%20%22%3CSTRONG%3E%26lt%3B%26lt%3B%3CEM%3EModal%3C%2FEM%3E%3C%2FSTRONG%3E%22%20window%2C%26nbsp%3Bbut%20is%20there%20an%20alternate%20way%3F%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EFound%20this%20threat%20but%20it%20runs%20a%20scheduler%20in%20the%20background%20which%20I%20don't%20prefer%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FHow-to-stop-users-from-resizing-windows-in-JSL%2Ftd-p%2F15168%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FHow-to-stop-users-from-resizing-windows-in-JSL%2Ftd-p%2F15168%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Jackie__0-1727098266586.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jackie__0-1727098266586.png%22%20style%3D%22width%3A%20198px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jackie__0-1727098266586.png%22%20style%3D%22width%3A%20198px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jackie__0-1727098266586.png%22%20style%3D%22width%3A%20198px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jackie__0-1727098266586.png%22%20style%3D%22width%3A%20198px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jackie__0-1727098266586.png%22%20style%3D%22width%3A%20198px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jackie__0-1727098266586.png%22%20style%3D%22width%3A%20198px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F68534i81DADF8B3EAD97DF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Jackie__0-1727098266586.png%22%20alt%3D%22Jackie__0-1727098266586.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-801318%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3EAutomation%20and%20Scripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-801339%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Preventing%20New%20Window%20from%20being%20maximized%2Fresized%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-801339%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ELook%20in%20the%20Scripting%20Index%20for%20Window%20Size%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ew%20%3D%20new%20window(%22test%22)%3B%0Aw%20%26lt%3B%26lt%3B%20Set%20Window%20Size(%20800%2C%201200%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-801341%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Preventing%20New%20Window%20from%20being%20maximized%2Fresized%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-801341%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ETo%20my%20knowledge%20you%20cannot%20easily%20do%20this%2C%20but%20few%20questions%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EThe%20most%20important%20question%3A%20why%20would%20you%20want%20to%20prevent%20user%20from%20resizing%20a%20window%20(doesn't%20really%20fit%20the%20feeling%20of%20JMP%20to%20not%20be%20able%20to%20resize%20a%20window).%3CBR%20%2F%3E%0A%3COL%3E%0A%3CLI%3EOne%20window%20in%20JMP%20which%20prevents%20you%20from%20maximizing%20it%20and%20it%20is%20Legend%20window%20but%20you%20can%20still%20resize%20it%20so%20maybe%20there%20is%20a%20way%20to%20disable%20maximizing%3C%2FLI%3E%0A%3CLI%3EOther%20is%20Caption()%20but%20it%20is%20it's%20own%20thing%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EIf%20you%20wish%20to%20prevent%20resizing%2C%20why%20not%20use%20modal%20window%3F%3C%2FLI%3E%0A%3CLI%3EIs%20there%20a%20specific%20issue%20in%20using%20scheduler%3F%3C%2FLI%3E%0A%3CLI%3EThat%20thread%20has%20the%20most%20probable%20answer%3A%20you%20might%20have%20to%20go%20outside%20the%20%3CSTRONG%3Escripting%3C%2FSTRONG%3E%20language%20and%20do%20it%20from%20the%20operating%20system%3C%2FLI%3E%0A%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-801345%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Preventing%20New%20Window%20from%20being%20maximized%2Fresized%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-801345%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F14366%22%20target%3D%22_blank%22%3E%40jthi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3EOne%20window%20in%20JMP%20which%20prevents%20you%20from%20maximizing%20it%20and%20it%20is%20Legend%20window%20but%20you%20can%20still%20resize%20it%20so%20maybe%20there%20is%20a%20way%20to%20disable%20maximizing%20-%20%3CSTRONG%3EI%20have%20never%20came%20across%20this%2C%20can%20you%20share%20an%20example%20code%3F%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FOL%3E%3COL%3E%3CLI%3EIf%20you%20wish%20to%20prevent%20resizing%2C%20why%20not%20use%20a%20modal%20window%3F%20-%20%3CSTRONG%3EBcos%20Modal%20window%20prevents%20accessing%20other%20files%2Ftables%3C%2FSTRONG%3E%26nbsp%3B%3C%2FLI%3E%3CLI%3EIs%20there%20a%20specific%20issue%20in%20using%20scheduler%3F%20%3CSTRONG%3EThe%20issue%20is%20it%20slows%20down%20the%20loop%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-801347%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Preventing%20New%20Window%20from%20being%20maximized%2Fresized%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-801347%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ENo%20idea%20how%20that%20could%20be%20done.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20if%20you%20wish%20to%20provide%20very%20annoying%20user%20experience%20you%20can%20use%20graphic%20scripts%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Anw%20%3D%20New%20Window(%22Example%22%2C%20%26lt%3B%3CSIZE%3E%3C%2FSIZE%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-801350%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Preventing%20New%20Window%20from%20being%20maximized%2Fresized%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-801350%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThis%20is%20a%20nice%20hack.%20Thanks%20Jarmo%3C%2FP%3E%3C%2FLINGO-BODY%3E
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