Handling text in Dialog windows

Hi folks,

I would like to know how to modify text parameters in GenericDialog or with another class using eval() macro function or simply using Dialog.create() macro function. In the next lines I attach two examples with Dialog macro function and GenericDialog() class using eval(“script”, javascript) macro function:

//Using macro function
Dialog.createNonBlocking("TEXT EXAMPLE 1");
Dialog.addMessage("MODE");
Dialog.addMessage("This is a text example without justified margins and withouth applied fonts\nand I would like to change the text font and justified the margins");
Dialog.show();
//Using eval() function
title = "TEXT EXAMPLE 2";
x_1=500; y_1= 500;
message = "This is a text example without justified margins and withouth applied fonts";
message1= "and I would like to change the text font and justified the margins";
script = "var gdo = new NonBlockingGenericDialog('"+title+"');gdo.addMessage('"+message+"');gdo.addMessage('"+message1+"');gdo.setLocation("+x_1+","+y_1+");gdo.showDialog();";
res = eval("script", script);

Thanks

Luis

Hi @Professor_OAT,

I’m not sure if the eval() statement is necessary for that.

Shouldn’t it be possible to call something like this:

title = "TEXT EXAMPLE 2";
x_1=500; 
y_1= 500;
message = "This is a text example without justified margins and withouth applied fonts";
message1= "and I would like to change the text font and justified the margins";

Dialog.createNonBlocking(title);
Dialog.addMessage(message);
Dialog.addMessage(message1);
Dialog.setLocation(x_1, y_1);
Dialog.show();

Let us know if this helps.

Cheers,
Robert

1 Like

Hi @haesleinhuepf,

It was so useful.

Thanks!

1 Like