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
Andyon98
Level II

How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

I cant seem to remove this button and I need to in order to make my GUI look more presentable.

8 REPLIES 8

Re: How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

Is the window modal? Then JMP insists that at least one button is available to dismiss the window. If you simply want a different button title, you can change "OK" to something else.

Andyon98
Level II

Re: How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

It’s unusual though as I do have buttons on this particular window, so it’s confusing on why it’s showing up. I need the window to be Modal too.

Re: How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

I usually recommend against deleting display boxes. Instead, you can control the visibility. Use the selected message as shown in this picture. I do not know how it will affect the behavior of the window if you hide or collapse the OK button. You must provide a way to dismiss the modal window.

 

vis.PNG

David_Burnham
Super User (Alumni)

Re: How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

If you don't need the button, don't use a modal window.  The only time you need a modal window is when there is an absolute requirement for the user to respond before processing user input data.  If you look at the JMP user interface (almost) none of windows are modal.

-Dave
Andyon98
Level II

Re: How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

I have other buttons on the menu but it still pops up. It’s probably because it’s modal, but I must make the window Modal as it relies on user input.
David_Burnham
Super User (Alumni)

Re: How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

The OK button appears because you are creating a modal window.  If you don't want it, don't make the window modal.  It's your choice; just because your are collecting user input doesn't mean you need to have a modal window.

-Dave
ErraticAttack
Level VI

Re: How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

I personally don't like the idea of criticizing a users use-case.  I too have controlled and do control the added buttons that modal windows can create.  Note that if you create your own button called "OK" then the modal window will not add an "OK" button, but if you do want to get rid of an added button, here is an example showing how using the <<On Open() method.  I use the <<XPath( "//ButtonBox" ) method to grab a list of all button boxes then hide the last one (the added button box will always be the last)

 

new window( "test",
	<<Modal,
	<<On Open(
		button boxes = ((tree <<Parent) <<Parent) << XPath( "//ButtonBox" );
		button boxes[N Items( button boxes )] << Visibility( "Collapse" );
	)
,
	tree = V List Box(
		Button Box( "My button " )
	,
		Button Box( "My Other Button!!" )
	,
		Button Box( "My awesome button for doing all the things " )
	,
		Button Box( "This button erases your HD" )
	,
		Button Box( "all your base are belong to us" )
	)
)

 

Or you can use this cheeky way (since creating a button labeled "OK" stops JMP from adding an OK button):

new window( "test",
	<<Modal,
	tree = V List Box(
		Button Box( "OK", <<Visibility( "Collapse" ) )
	,
		Button Box( "My Other Button!!" )
	,
		Button Box( "My awesome button for doing all the things " )
	,
		Button Box( "This button erases your HD" )
	,
		Button Box( "all your base are belong to us" )
	)
)

The advantage with this second method is that you can do something like this, which will trigger the normal Modal Window closing mechanism (including running any validation script)

new window( "test",
	<<Modal,
	tree = V List Box(
		window:OK Button = Button Box( "OK", <<Visibility( "Collapse" ) )
	,
		Button Box( "My Other Button!!" )
	,
		Button Box( "My awesome button for doing all the things " )
	,
		Button Box( "This button erases your HD" )
	,
		Button Box( "all your base are belong to us" )
	,
		Button Box( "Submit", window:OK Button << Click )
	)
)
Jordan
ih
Super User (Alumni) ih
Super User (Alumni)

Re: How do you remove the "Ok" button that pops up in your menus when you use New Window and Modal?

Note that @ErraticAttack 's second method is the documented and recommended way to solve this.  From the 'Construct a Modal Window' section of the help files:

 

 

win = New Window( "No OK Button",
	<<Modal,
	b = Button Box( "Close Window", b << Close Window ),
	bb = Button Box( "OK", <<Visibility( "collapse" ) )
);