Copy link to clipboard
Copied
Hello,
Is there a way of changing the statictext length in scriptui after the window is displayed?
I'm trying to do something like below:
Sometext = win.add('statictext', undefined, 'Hello World');
Button = win.add('button {text: "Change"}')
Button.onClick = function()
{
van newText = 'This is considerably longer text than Hello World which I would like to see in whole';
Sometext.characters = newText.length;
Sometext.text = newText;
win.layout.layout(true);
}
win.show();
Copy link to clipboard
Copied
// Try this
var d = new Window("dialog", "");
var t = d.add("statictext", undefined, "1234");
t.preferredSize.width = 300;
var b = d.add("button", undefined, "test")
b.onClick = function ()
{
try {
t.size.width = 20;
// d.layout.layout(true); // resizes d always
// d.layout.resize(); // resizes d if t does not fit in d
}
catch(e) { alert(e); }
}
d.show()