Customize text and field labels in dialog boxes

imagej

#1

Hi everybody,
Does anyone have a simple macro command to bold, underline, or italicize the text and field labels in dialog boxes? Can the fonts be changed ?
Any suggestions/workarounds would be
greatly appreciated.
FARES


#2

Unfortunately there is very littke aesthetic customization you can do unless you move to a plugin or command where you code your own interface (I’d be happy to be corrected if I am wrong). I found older posts confirming this…

Can Script Parameters be customized?

Please consider dialogs as cues for your users and to help structure the workflow you need. We make use of Dialog.addMessage() to inform the users of particular things.
If your dialog becomes too big or unusable to the point that it requires changing fonts or colors for clarity, then the macro language is probably not suited to your workflow (at least from a useability point of view).

Sorry I could not be more helpful


#3

Yes, absolutely :slight_smile:

This Groovy script illustrates the use of formatting in script parameters:

#@ String (label = "<html>Labels <i>italic</i> and <b>bold</b></html>", description = "<html>In labels, descriptions and messages, you can use <b><i>italic bold</i></b> formatting</html>") myTextInput
#@ String (value = "<html>Some HTML tags are supported, e.g.<br>&lt;code&gt; <code>IJ.log(\"@\")</code><br>&lt;b&gt; <b>bold</b><br>&lt;i&gt; <i>italic</i></html>", persist = true, visibility = MESSAGE) message

println myTextInput

Run it from the script editor to try it.