Hi Alex, Thanks for your email. The output from the qx_log window is below. I should also note that I'm fairly sure the application is using my custom theme because if I override the appearance settings for a label, say setting the background colour to be blue, it works. It just doesn't seem to be using my appearance settings for the client-document.
Tom 015772 DEBUG: qx.core.Init[3]: qooxdoo 0.6.6 015774 DEBUG: qx.core.Init[3]: loaded 307 classes 015776 DEBUG: qx.core.Init[3]: client: gecko-1.8/win/en 015781 INFO: qx.component.init.InterfaceInitComponent[30]: initialize runtime: 1ms 015845 DEBUG: ajax_ide.Application[26]: --- Object: [object ajax_ide.theme.appearance.customTheme] --- _appearances=[object Object] _dbKey=35 _disposed=false _hashCode=42 _properties=enabled,title _valueEnabled=true _valueTitle=Custom Appearance classname=ajax_ide.theme.appearance.customTheme constructor=function (vTitle) { qx.theme.appearance.Classic.call(this, vTitle || "Custom Appearance"); } debug=function (msg, exc) { this.getLogger().debug(msg, this._hashCode, exc); } dispose=function () { if (this.getDisposed()) { return; } this._appearances = null; return qx.core.Object.prototype.dispose.call(this); } error=function (msg, exc) { this.getLogger().error(msg, this._hashCode, exc); } forceEnabled=function (newValue) { return this[valueKey] = newValue; } forceTitle=function (newValue) { return this[valueKey] = newValue; } get=function (propertyNames, outputHint) { switch (typeof propertyNames) { case "string": return this["get" + qx.lang.String.toFirstUp(propertyNames)](); case "object": if (typeof propertyNames.length === "number") { if (outputHint == "hash") { var h = {}; propertyLength = propertyNames.length; for (var i = 0; i < propertyLength; i++) { try { h[propertyNames[i]] = this["get" + qx.lang.String.toFirstUp(propertyNames[i])](); } catch (ex) { throw new Error("Could not get a valid value from property: " + propertyNames[i] + "! Is the property existing? (" + ex + ")"); } } return h; } else { propertyLength = propertyNames.length; for (var i = 0; i < propertyLength; i++) { try { propertyNames[i] = this["get" + qx.lang.String.toFirstUp(propertyNames[i])](); } catch (ex) { throw new Error("Could not get a valid value from property: " + propertyNames[i] + "! Is the property existing? (" + ex + ")"); } } return propertyNames; } } else { for (var i in propertyNames) { propertyNames[i] = this["get" + qx.lang.String.toFirstUp(i)](); } return propertyNames; } default: throw new Error("Please use a valid array, hash or string as parameter!"); } } getAppearance=function (vId) { return this._appearances[vId]; } getDisposed=function () { return this._disposed; } getEnabled=function () { return this[valueKey]; } getLogger=function () { return qx.log.Logger.getClassLogger(this.constructor); } getSetting=function (vKey) { return qx.Settings.getValueOfClass(this.classname, vKey); } getTitle=function () { return this[valueKey]; } getUserData=function (vKey) { if (!this._userData) { return null; } return this._userData[vKey]; } info=function (msg, exc) { this.getLogger().info(msg, this._hashCode, exc); } initialFrom=function (vId) { var vAppearance = this.getAppearance(vId); if (vAppearance) { this.setupAppearance(vAppearance); try { return vAppearance.initial ? vAppearance.initial(this) : {}; } catch (ex) { this.error("Couldn't apply initial appearance", ex); } } else { return this.error("Missing appearance: " + vId); } } isDisposed=function () { return this._disposed; } isEnabled=function () { return this[valueKey]; } marktr=function (messageId) { var nlsManager = qx.locale.Manager; return nlsManager.marktr.apply(nlsManager, arguments); } registerAppearance=function (vId, vData) { this._appearances[vId] = vData; } resetEnabled=function () { return this["set" + p.method](p.defaultValue); } resetTitle=function () { return this["set" + p.method](p.defaultValue); } set=function (propertyValues) { if (typeof propertyValues !== "object") { throw new Error("Please use a valid hash of property key-values pairs."); } for (var prop in propertyValues) { try { this[qx.OO.setter[prop]](propertyValues[prop]); } catch (ex) { this.error("Setter of property '" + prop + "' returned with an error", ex); } } return this; } setEnabled=function (newValue) { var oldValue = this[valueKey]; if (newValue === oldValue) { return newValue; } if (!(p.allowNull && newValue == null)) { if (p.hasType && typeof newValue !== p.type) { return this.error("Attention! The value \"" + newValue + "\" is an invalid value for the property \"" + p.name + "\" which must be typeof \"" + p.type + "\" but is typeof \"" + typeof newValue + "\"!", new Error); } } if (this[checkKey]) { try { newValue = this[checkKey](newValue, p); if (newValue === oldValue) { return newValue; } } catch (ex) { return this.error("Failed to check property " + p.name, ex); } } this[valueKey] = newValue; if (this[modifyKey]) { try { var r = this[modifyKey](newValue, oldValue, p); if (!r) { var valueStr = (new String(newValue)).substring(0, 50); return this.error("Setting property \"" + p.name + "\" to \"" + valueStr + "\" failed without exception (" + r + ")", new Error); } } catch (ex) { var valueStr = (new String(newValue)).substring(0, 50); return this.error("Setting property \"" + p.name + "\" to \"" + valueStr + "\" failed with exception", ex); } } if (this.hasEventListeners && this.hasEventListeners(changeKey)) { var vEvent = new qx.event.type.DataEvent(changeKey, newValue, oldValue, false); vEvent.setTarget(this); try { this.dispatchEvent(vEvent, true); } catch (ex) { throw new Error("Property " + p.name + " modified: Failed to dispatch change event: " + ex); } } return newValue; } setTitle=function (newValue) { var oldValue = this[valueKey]; if (newValue === oldValue) { return newValue; } if (!(p.allowNull && newValue == null)) { if (p.hasType && typeof newValue !== p.type) { return this.error("Attention! The value \"" + newValue + "\" is an invalid value for the property \"" + p.name + "\" which must be typeof \"" + p.type + "\" but is typeof \"" + typeof newValue + "\"!", new Error); } } if (this[checkKey]) { try { newValue = this[checkKey](newValue, p); if (newValue === oldValue) { return newValue; } } catch (ex) { return this.error("Failed to check property " + p.name, ex); } } this[valueKey] = newValue; if (this[modifyKey]) { try { var r = this[modifyKey](newValue, oldValue, p); if (!r) { var valueStr = (new String(newValue)).substring(0, 50); return this.error("Setting property \"" + p.name + "\" to \"" + valueStr + "\" failed without exception (" + r + ")", new Error); } } catch (ex) { var valueStr = (new String(newValue)).substring(0, 50); return this.error("Setting property \"" + p.name + "\" to \"" + valueStr + "\" failed with exception", ex); } } if (this.hasEventListeners && this.hasEventListeners(changeKey)) { var vEvent = new qx.event.type.DataEvent(changeKey, newValue, oldValue, false); vEvent.setTarget(this); try { this.dispatchEvent(vEvent, true); } catch (ex) { throw new Error("Property " + p.name + " modified: Failed to dispatch change event: " + ex); } } return newValue; } setUserData=function (vKey, vValue) { if (!this._userData) { this._userData = {}; } this._userData[vKey] = vValue; } setupAppearance=function (vAppearance) { if (!vAppearance._setupDone) { if (vAppearance.setup) { vAppearance.setup(this); } vAppearance._setupDone = true; } } stateFrom=function (vId, vStates) { var vAppearance = this.getAppearance(vId); if (vAppearance) { this.setupAppearance(vAppearance); try { return vAppearance.state ? vAppearance.state(this, vStates) : {}; } catch (ex) { this.error("Couldn't apply state appearance", ex); } } else { return this.error("Missing appearance: " + vId); } } toHashCode=function () { return this._hashCode; } toString=function () { if (this.classname) { return "[object " + this.classname + "]"; } return "[object Object]"; } toggleEnabled=function (newValue) { return this["set" + p.method](!this[valueKey]); } tr=function (messageId, varargs) { var nlsManager = qx.locale.Manager; return nlsManager.tr.apply(nlsManager, arguments); } trn=function (singularMessageId, pluralMessageId, count, varargs) { var nlsManager = qx.locale.Manager; return nlsManager.trn.apply(nlsManager, arguments); } warn=function (msg, exc) { this.getLogger().warn(msg, this._hashCode, exc); } --- End of object --- 016052 INFO: qx.component.init.InterfaceInitComponent[30]: main runtime: 269ms 016056 DEBUG: qx.component.init.InterfaceInitComponent[30]: preloading visible images... 017232 DEBUG: qx.component.init.InterfaceInitComponent[30]: preloading complete 017454 INFO: qx.component.init.InterfaceInitComponent[30]: finalize runtime: 222ms 018908 DEBUG: qx.component.init.InterfaceInitComponent[30]: preloading hidden images... 018913 DEBUG: qx.component.init.InterfaceInitComponent[30]: preloading complete -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alex Back Sent: 10 April 2007 15:59 To: qooxdoo Development Subject: Re: [qooxdoo-devel] Changing the default background colour Hi Tom, the way you described should work. What is your output when you insert the following line in your main-method: this.debug(qx.manager.object.AppearanceManager.getInstance().getAppearanceTh eme()); Just give it a shot. Maybe I can help you a little bit to track down this problem. cheers, Alex On Tuesday 10 April 2007 Tom Hunter wrote: > Hi, > > > > I'm trying to change the default background colour in my application. > > > > I understand the background colour is set in qx.theme.appearance.Classic, > under the client-document key, and changing it here works OK, but what I > want to do is create a custom theme that inherits from the Classic theme, > as described in the documentation > (http://qooxdoo.org/documentation/user_manual/create_a_custom_appearance). > So I've created my custom theme class and set it as the appearance theme in > my application initialisation. However, overriding the client-document key > and setting a new background colour doesn't seem to have any effect. I've > resorted to setting the background colour manually in the main method: > > > > var d = qx.ui.core.ClientDocument.getInstance(); > > d.setBackgroundColor(null); > > > > The code for my custom theme is below. Any help would be much appreciated. > (If anyone's interested, I'm trying to build an Ajax powered IDE.) > > > > qx.OO.defineClass("ajax_ide.theme.appearance.customTheme", > qx.theme.appearance.Classic, > function(vTitle) { > qx.theme.appearance.Classic.call(this, vTitle || "Custom Appearance"); > }); > > // Define appearances > qx.Proto._appearances = qx.lang.Object.carefullyMergeWith( { > /* > * My custom appearance settings here > */ > > "client-document" : { // This doesn't seem to be working for some > reason... > setup : function() { > this.bgcolor = new qx.renderer.color.ColorObject("#FFFFFF"); > this.color = new qx.renderer.color.ColorObject("windowtext"); > }, > > initial : function(vTheme) { > return { > backgroundColor : this.bgcolor, > color : this.color, > hideFocus : true, > enableElementFocus : false > } > } > }, > > }, qx.Super.prototype._appearances); > > // Singleton instance getter > qx.Clazz.getInstance = qx.lang.Function.returnInstance; > > // Register the appearance theme to the appearance manager > qx.manager.object.AppearanceManager.getInstance().registerAppearanceTheme(q >x .Clazz); > > > > > > Tom ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel