1
0
Fork 0
fgdata/Nasal/canvas/gui/Config.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
377 B
Text

var Config = {
new: func(cfg)
{
var m = {
parents: [Config],
_cfg: cfg
};
if( typeof(m._cfg) != "hash" )
m._cfg = {};
return m;
},
get: func(key, default = nil)
{
var val = me._cfg[key];
if( val != nil )
return val;
return default;
},
set: func(key, value)
{
me._cfg[key] = value;
return me;
}
};