Skip to main content
gregreser
Legend
October 24, 2022
Question

Bridge 13 scriptUI: font style/color/size no longer work

  • October 24, 2022
  • 1 reply
  • 243 views

Setting these ScriptUIGraphics object properties has no effect in the UI display:

 

graphics.font  

graphics.foregroundColor

graphics.newPen

 

(for edittext object)

graphics.backgroundColor

graphics.newBrush

 

 

#target bridge

var w = new Window ("window");
w.graphics.backgroundColor = w.graphics.newBrush (w.graphics.BrushType.SOLID_COLOR, [0.1, 0.2, 0.4]);

var s = w.add ("statictext", undefined, "Static Text");
s.preferredSize = [200,60];
s.graphics.font = ScriptUI.newFont ("Helvetica", "Bold", 30);
s.graphics.foregroundColor = s.graphics.newPen( s.graphics.PenType.SOLID_COLOR, [0.7, 0.5, 0.2], 1);

var e = w.add ("edittext", undefined, "Edit Text");
e.preferredSize = [300,25];
e.graphics.font = ScriptUI.newFont ("Times", "Regular", 16);
e.graphics.foregroundColor = e.graphics.newPen (e.graphics.PenType.SOLID_COLOR, [0.6, 0.2, 0.0], 1);
e.graphics.backgroundColor = e.graphics.newBrush (e.graphics.BrushType.SOLID_COLOR, [1, 1, 1]);

var g = w.add('group', undefined, "Group")
g.preferredSize = [200,60]
g.graphics.foregroundColor = g.graphics.newPen (g.graphics.PenType.SOLID_COLOR, [0.3, 1, 0.2], 1);
g.graphics.backgroundColor = g.graphics.newBrush (g.graphics.BrushType.SOLID_COLOR, [0.2, 0.4, 0.8]);
text = g.add ("statictext", undefined, "Group Static Text");
text.graphics.font = ScriptUI.newFont ("Times", "Italic", 20);

var p =  w.add('panel', undefined, "Panel")
p.preferredSize = [200,60]
p.graphics.backgroundColor = p.graphics.newBrush (p.graphics.BrushType.SOLID_COLOR, [0.6, 0.7, 0.1]);

var b = w.add ("button", undefined, "Button ");
b.preferredSize = [150,40];
b.graphics.font = ScriptUI.newFont ("Helvetica", "Bold", 16);

w.show ();

 

This topic has been closed for replies.

1 reply

Chuck Uebele
Community Expert
Community Expert
October 24, 2022

I'm getting the same as you. I'm not sure what changes.