My programming skill is not enough to solve this problem. Hope someone could
help me.

I have a class "myButton" which made a simple button.
I have a static class "myFunctions" which conatains myFunction1(),
myFunction2() and so on.

I would like to make instances of myButton class: myButton1, myButton2...
Is it possible to pass the appropriate myFunction() to the myButton
constructor, something like this:

<code>
var currentFunction = qx.myFunctions.myFunction1();
var myButton1 = new qx.myButton(currentFunction);

var currentFunction = qx.myFunctions.myFunction2();
var myButton2 = new qx.myButton(currentFunction);
</code>

And in the myButton constructor something like this:

<code>
construct: function(currFn) {
   this.addListener("click", function(e) {
        currFn;
   });
});
</code>
-- 
View this message in context: 
http://old.nabble.com/pass-a-functions-name-to-a-class-tp26264754p26264754.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to