• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change statictext length dynamically

Explorer ,
Nov 14, 2017 Nov 14, 2017

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();

TOPICS
Actions and scripting

Views

782

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
People's Champ ,
Nov 14, 2017 Nov 14, 2017

Copy link to clipboard

Copied

LATEST

// 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()

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines