취소
다음에 대한 결과 표시 
표시  만  | 다음에 대한 검색 
다음을 의미합니까? 

Discussions

Solve problems, and share tips and tricks with other JMP users.
언어 선택 변환 막대 숨기기
Andyon98
Level II

I have a "Do you want to quit button" with ""Yes" and "No" buttons. How do I close the window along with the main menu from which I press cancel from?

I was wondering how would I close all windows from pressing on the yes button, im sure its simple... im just not sure on how to write it the most efficient way.

1 채택된 솔루션

채택된 솔루션
jthi
Super User

Re: I have a "Do you want to quit button" with ""Yes" and "No" buttons. How do I close the window along with the main menu from which I press cancel from?

Not exactly sure what you are after, but maybe something like this?

Names Default To Here(1);

nw1_expr = Expr(
	New Window("1",
		Text Box("Window1"),
		H List Box(
			Button Box("OK"),
			Button Box("Cancel", << Set Function(function({this},
				(this << top parent) << Close Window;
				nw2_expr;
			)))
		)
	);
);

nw2_expr = Expr(
	New Window("2",
		Text Box("Window2"),
		H List Box(
			Button Box("OK"),
			Button Box("No", << Set Function(function({this},
				(this << top parent) << Close Window;
				nw1_expr;
			)))
		)
	);
);

nw1_expr;
-Jarmo

원본 게시물의 솔루션 보기

4 응답 4
txnelson
Super User

Re: I have a "Do you want to quit button" with ""Yes" and "No" buttons. How do I close the window along with the main menu from which I press cancel from?

Here is a bit of JSL that seems to close all of the windows and then closes JMP.  There may be easier ways.

Names Default To Here( 1 );
cw = Current Window() << get window title;

For( i = 99, i >= 1, i--,
	If( Window( i ) << get window title != cw & Window( i ) << get window title != "",
		Window( i ) << close window
	)
);
Main Menu( "exit jmp" );
Jim
Andyon98
Level II

Re: I have a "Do you want to quit button" with ""Yes" and "No" buttons. How do I close the window along with the main menu from which I press cancel from?

Say I don’t want to close jmp and I only want to close one window at a time; e.g.

You press cancel on the first window and another window pops up, at this point you want the first window to close as the second window has opened.

Then if you press on the “No” button box of the second menu, the second menu should close and the first menu should open again or you should be presented with the first menu again.
jthi
Super User

Re: I have a "Do you want to quit button" with ""Yes" and "No" buttons. How do I close the window along with the main menu from which I press cancel from?

Not exactly sure what you are after, but maybe something like this?

Names Default To Here(1);

nw1_expr = Expr(
	New Window("1",
		Text Box("Window1"),
		H List Box(
			Button Box("OK"),
			Button Box("Cancel", << Set Function(function({this},
				(this << top parent) << Close Window;
				nw2_expr;
			)))
		)
	);
);

nw2_expr = Expr(
	New Window("2",
		Text Box("Window2"),
		H List Box(
			Button Box("OK"),
			Button Box("No", << Set Function(function({this},
				(this << top parent) << Close Window;
				nw1_expr;
			)))
		)
	);
);

nw1_expr;
-Jarmo
Andyon98
Level II

Re: I have a "Do you want to quit button" with ""Yes" and "No" buttons. How do I close the window along with the main menu from which I press cancel from?

That's exactly what I was looking for, thank you!

추천 글