- * @arg xtype {String|Function} constructor or string.
- * @arg id {String} (optional) id for registry
- * @arg xns {String|Object} (optional) namespace eg. Gtk or 'Gtk' - used with xtype.
- * @arg items {Array} (optional) list of child elements which will be constructed.. using XObject
+ * @arg xtype {String|Function} constructor or string.
+ * @arg id {String} (optional) id for registry
+ * @arg xns {String|Object} (optional) namespace eg. Gtk or 'Gtk' - used with xtype.
+ * @arg items {Array} (optional) list of child elements which will be constructed.. using XObject
- * @arg pack {Function|String|Array} (optional) how this object gets added to it's parent
- * @arg el {Object} (optional) premade GObject
+ * @arg pack {Function|String|Array} (optional) how this object gets added to it's parent
+ * @arg el {Object} (optional) premade GObject
if (typeof(item.pack) == 'function') {
// parent, child
item.pack.apply(o, [ o , o.items[i] ]);
item.parent = this;
return;
}
if (typeof(item.pack) == 'function') {
// parent, child
item.pack.apply(o, [ o , o.items[i] ]);
item.parent = this;
return;
}
- * @method addListener
- * Connects a method to a signal. (gjs/Seed aware)
- *
- * @arg sig {String} name of signal
- * @arg fn {Function} handler.
- */
+ * @method addListener
+ * Connects a method to a signal. (gjs/Seed aware)
+ *
+ * @arg sig {String} name of signal
+ * @arg fn {Function} handler.
+ */
- /**
- * @method get
- * Finds an object in the child elements using xid of object.
- * prefix with '.' to look up the tree.. multiple '..' to look further up..
- *
- * @arg name {String} name of signal
- * @return {XObject|false} the object if found.
- */
+
+ /**
+ * @method get
+ * Finds an object in the child elements using xid of object.
+ * prefix with '.' to look up the tree.. multiple '..' to look further up..
+ *
+ * @arg name {String} name of signal
+ * @return {XObject|false} the object if found.
+ */
XObject.extend = function(o, c, defaults){
if(defaults){
// no "this" reference for friendly out of scope calls
XObject.extend = function(o, c, defaults){
if(defaults){
// no "this" reference for friendly out of scope calls
extendIf : function(o, c){
if(!o || !c || typeof c != 'object'){
return o;
}
extendIf : function(o, c){
if(!o || !c || typeof c != 'object'){
return o;
}
/**
* Extends one class with another class and optionally overrides members with the passed literal. This class
* also adds the function "override()" to the class that can be used to override
/**
* Extends one class with another class and optionally overrides members with the passed literal. This class
* also adds the function "override()" to the class that can be used to override
* @param {Function} constructor The class inheriting the functionality
* @param {Object} superclass The class being extended
* @param {Object} overrides (optional) A literal with members
* @param {Function} constructor The class inheriting the functionality
* @param {Object} superclass The class being extended
* @param {Object} overrides (optional) A literal with members
return function(sb, sp, overrides) {
if (typeof(sp) == 'undefined') {
// error condition - try and dump..
return function(sb, sp, overrides) {
if (typeof(sp) == 'undefined') {
// error condition - try and dump..
createDelegate : function(method, obj, args, appendArgs){
return function() {
createDelegate : function(method, obj, args, appendArgs){
return function() {
callArgs = Array.prototype.slice.call(arguments, 0);
callArgs = callArgs.concat(args);
}else if(typeof appendArgs == "number"){
callArgs = Array.prototype.slice.call(arguments, 0);
callArgs = callArgs.concat(args);
}else if(typeof appendArgs == "number"){
- callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first
- var applyArgs = [appendArgs, 0].concat(args); // create method call params
+ callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first
+ var applyArgs = [appendArgs, 0].concat(args); // create method call params
Array.prototype.splice.apply(callArgs, applyArgs); // splice them in
}
return method.apply(obj || window, callArgs);
};
}
Array.prototype.splice.apply(callArgs, applyArgs); // splice them in
}
return method.apply(obj || window, callArgs);
};
}