cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Custom Icons for Button Box

shoffmeister
Level V

Hey JMPers!

 

Again a little scripting problem: I would like to add a custom image to a ButtonBox. Sadly it does not work. My script looks like this:

 

New Window("My Window",
	V List Box(
		bb = Button Box("New Project");
	)
);

// bb << Set Icon("JMP"); // This works!
bb <<Set Icon("../imgs/New Project Icon.png"); // => Gives "Unknown" in the log!!!

New Image(Open("../imgs/New Project Icon.png")); // Opens the image. Path seems to work fine

As you can see, JMP is able to find my image, as the last line of the script works without error. But the second to last line produces the message "Unknown" in the log and doe not add the Image to the Button. 

 

Thanks for any advice,

Sebastian

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Custom Icons for Button Box

Try using an absolute filepath instead of a relative filepath. A button has its own context and does not know anything about the script that created it.

View solution in original post

2 REPLIES 2
pmroz
Super User


Re: Custom Icons for Button Box

Change the semicolon to a comma for your button box definition::

bb = Button Box("New Project"),

This works in JMP 13:

a = new window("test",
	b = button box("Bar Chart"),
);

b << set icon("C:\JMP\Icons\icon-48x48-chart_bar.png");

BarchartButton.png

Re: Custom Icons for Button Box

Try using an absolute filepath instead of a relative filepath. A button has its own context and does not know anything about the script that created it.