Highlighted

How to control ScriptUI editText ScrollBar

New Here ,
Jun 02, 2020

Copy link to clipboard

Copied

 

 

w = new Window('dialog', 'multiline');
w.alignChildren = 'left';
var group1 = w.add("group", undefined, { name: "group1" });
group1.orientation = "column";
var editText = group1.add("editText", undefined, undefined, { multiline: true, scrolling: true, readonly: true});
editText.preferredSize.height = 500;
editText.preferredSize.width = 500;
editText.text = "123";
var addTextButton = w.add('button', undefined, 'addText');
addTextButton.onClick = function addTextButton_onClick() {
  editText.text =  editText.text.concat("\riiiii");
}
w.show();

 

I have a long editText, and everytime when I update text, the scrollbar will move to the top, but I want it to stay at the buttom. Is there any way to control scrollbar's value of editText? Thanks

 

 

Most Valuable Participant
Correct answer by Mylenium | Most Valuable Participant

I don't think that there is a way to set a persistent view region for a text in any way...

 

Mylenium

TOPICS
How to

Views

131

Likes

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

How to control ScriptUI editText ScrollBar

New Here ,
Jun 02, 2020

Copy link to clipboard

Copied

 

 

w = new Window('dialog', 'multiline');
w.alignChildren = 'left';
var group1 = w.add("group", undefined, { name: "group1" });
group1.orientation = "column";
var editText = group1.add("editText", undefined, undefined, { multiline: true, scrolling: true, readonly: true});
editText.preferredSize.height = 500;
editText.preferredSize.width = 500;
editText.text = "123";
var addTextButton = w.add('button', undefined, 'addText');
addTextButton.onClick = function addTextButton_onClick() {
  editText.text =  editText.text.concat("\riiiii");
}
w.show();

 

I have a long editText, and everytime when I update text, the scrollbar will move to the top, but I want it to stay at the buttom. Is there any way to control scrollbar's value of editText? Thanks

 

 

Most Valuable Participant
Correct answer by Mylenium | Most Valuable Participant

I don't think that there is a way to set a persistent view region for a text in any way...

 

Mylenium

TOPICS
How to

Views

132

Likes

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
Jun 02, 2020 0
Most Valuable Participant ,
Jun 02, 2020

Copy link to clipboard

Copied

I don't think that there is a way to set a persistent view region for a text in any way...

 

Mylenium

Likes

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
Reply
Loading...
Jun 02, 2020 0