Copy link to clipboard
Copied
Hello,
using this simple one as an example:
var w = new Window('dialog');
w.preferredSize = [200,100];
w.et = w.add('edittext', void 0, "Some text");
w.et.preferredSize.height = 40;
w.show();
The "Some text" is placed top-left in the EditText - is it possible to control its alignment, i.e. ['center', 'middle']?
(just to be clear, I'm not interested in the EditText position within the Window, but just the text within the EditText itself).
Thank you!
Davide Barranca
Copy link to clipboard
Copied
Davide, use the below example with either left, center, or right. You have to have the justify line right after the line that creates the edittext box:
#target photoshop
var dlg = new Window('dialog','test')
dlg.txt = dlg.add('edittext',undefined,'this it the text');
dlg.txt.justify = 'center'
dlg.txt.size = [200,60]
dlg.show()
Copy link to clipboard
Copied
Hello Chuck,
thanks for the tip! Actually, I'm mostly bothered by the vertical alignment (top / middle / bottom) - since afaik I can't set any padding for the edittext I use to use bigger-than-default heigth - the only problem is that the text sticks on the top of the box, while it would be better looking if centered, along the Y axis.
Davide
Copy link to clipboard
Copied
I don't think there are controls for that.