Hello to all.

Can I create a class which inherits from a singleton class?

In my app my idea is have a singleton window type. It's named
adv4seller.SingletonWindow. So my idea is: every window in my
applicaition inherits from this class. Why? I need only one window of
each type: only one about window, only one credits window, etc.

Currently these are my classes:

qx.Class.define("adv4seller.SingletonWindow",
{
  extend: qx.ui.window.Window,

  type: "singleton",

  construct: function() {

    this.base(arguments);

    this.set({
      showClose: false,
      showMaximize: false,
      showMinimize: false
    });
  },

  members: {
  }

});

qx.Class.define("adv4seller.SingletonWindow2",
{
  extend: adv4seller.SingletonWindow,

  construct: function() {

    this.base(arguments);

    this.set({
      width: 400,
      height: 500
    });

  },
});

If I try to do:

var a = adv4seller.SingletonWindow2.getInstance()

The interpreter returns an error "getInstance is not a function"

What I need isn't a singleton superclass, but all inherited classes
with an singleton "property".  I think I'm probrably doing somethig
wrong. What's the "qx-way" to do this?

------------------------------------------------------------------------------
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

Reply via email to