Yep, MouseBox can do all of that. Mouseboxes can also hold data for you to use in a callback function. Below is a small example of using icons as buttons, but you could also use pictures.
Icon Mouse Box = Function( {icon, data},
MouseBox(
Icon Box( icon ),
<<Set User Data( data ),
<<Set Mark Enable( 1 ),
<<Set Mark(
Function( {this},
// set all of them to be unmarked
((this << parent) << XPath( "//MouseBox" )) << Set Marked( 0 );
// set this particular one to be marked
this << Set Marked( 1 );
// update something based on this mouse boxes data
txt << Set Text( Char( this << Get User Data ) );
)
)
)
);
New Window( "Example",
V List Box(
Panel Box( "Select an Icon",
H List Box(
Icon Mouse Box( "Nominal", ["type" => "nominal", "someOtherData" => 1] ),
Icon Mouse Box( "Ordinal", ["type" => "ordinal", "someOtherData" => 2] ),
Icon Mouse Box( "Continuous", ["type" => "continuous", "someOtherData" => 3] )
)
),
Text Box(), //Spacing
txt = Text Box( "Nothing selected" ),
<<Padding( {10, 10, 10, 10} )
)
);
Here's an aimated GIF of the above script in action:
The best real-life example I have of using icons with MouseBox is in my Built-In JMP Icons add-in. It has several mouse boxes within icons in them, with selection and hover actions.
My Word Import Tool, Add-In Manager and JMP User Community add-ins show a few more use cases for using mouse box, but the code in those is a bit more complex.
Justin