One answer would be a static member:
(Application.js):
"statics" : {
FONT : "16px Arial bold"
},
main : function() {
...
}
(Form.js):
...
Name.setFont(qx.bom.Font.fromString(myapp.Application.FONT));
...
T.
On 09/16/2010 12:25 PM, Ratibor Redoran wrote:
>
> Hello, guys!
>
> I have next problem: it needs to get the value of the variable (from main
> function (Application.js)) in the class instance.
>
> Example:
>
> //-------------------------------------------------------------------------------------------------------
>
> (Application.js)
>
> main : function()
> {
> var font = "16px Arial bold"; // In this place I define "font"
> variable
>
> var win = new form.Form();
>
> this.getRoot().add(win);
> win.open();
> }
>
> //-------------------------------------------------------------------------------------------------------
>
> (Form.js)
>
> qx.Class.define("form.Form",
> {
> extend : qx.ui.window.Window,
>
> construct: function()
> {
> this.base(arguments);
>
> var layer = new qx.ui.layout.VBox();
> this.setLayout(layer);
>
> var Name = new qx.ui.form.TextField();
> this.add(Name);
> Name.setFont(qx.bom.Font.fromString(font)); // Variable "font" is not
> defined in this place :(
> }
> });
>
> //-------------------------------------------------------------------------------------------------------
>
> Tell me please how to solve this problem?
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel