1
0
Fork 0
fgdata/Nasal/canvas/gui/widgets/Label.nas
Thomas Geymayer 3505d3c8bf canvas.gui: support height-for-width layouting.
Setting wordWrap on canvas.gui.Label enables height-for-width
where the height of the label depends on the layouted texts
width.
2014-06-13 00:34:44 +02:00

26 lines
495 B
Text

gui.widgets.Label = {
new: func(parent, style, cfg)
{
var m = gui.Widget.new(gui.widgets.Label);
m._cfg = Config.new(cfg);
m._focus_policy = m.NoFocus;
m._setView( style.createWidget(parent, "label", m._cfg) );
return m;
},
setText: func(text)
{
me._view.setText(me, text);
return me;
},
setImage: func(img)
{
me._view.setImage(me, img);
return me;
},
setBackground: func(bg)
{
me._view.setBackground(me, bg);
return me;
}
};