Hi Ralf,

calling setAppearance() resets those properties to its defaultValue which are 
defined in the original appearance but not in the new appearance. 
Let me explain this mechanism with your label example. 

The original "label"-appearance in the Classic appearance-theme defines wrap 
as "false". Your new "link-ref" appearance does not define the wrap property. 
The defaultValue for the "wrap"-property is "true".

In this case the call of "setAppearance" leads to following behaviour:
1. get the property values from the new appearance (->"link-ref")
2. if an original appearance exists, get also the original values (-> "label")
3. reset all properties to their default value which are defined in the 
original appearance ("label"), but not defined in the new appearance 
("link-ref")
4. set the properties defined in the new appearance

The third step is important in your case. You did not define any value 
for "wrap" in your appearance, so the widget gets resetted to its 
defaultValue.

I hope this explanation did answer your question ;-)

cheers,
  Alex

On Wednesday 04 April 2007 Ralf Sternberg wrote:
> Hi,
>
> I noticed that calling setAppearance on a Label resets its wrap property
> although the appearance theme contains no definition of this property.
> Example code:
>
>    label.setWrap( false );
>    label.debug( "_____ wrap before: " + label.getWrap() );
>    label.setAppearance( "link-ref" );
>    label.debug( "_____ wrap after: " + label.getWrap() );
>
> results in
>
>    DEBUG: qx.ui.basic.Label[1567]: _____ wrap before: false
>    DEBUG: qx.ui.basic.Label[1567]: _____ wrap after: true
>
> The appearance definition looks like this:
>
>    "link-ref" : {
>      initial : function( vTheme ) {
>        return {
>          cursor : "pointer"
>        }
>      }
>    }
>
> Does setAppearance() generally resets properties that are not
> explicitely defined in the appearance theme?
>
> Thanks,
>    Ralf
>
>
> -------------------------------------------------------------------------
> 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


-- 
Alexander Back
Core Development::Webtechnologies
[EMAIL PROTECTED]
fon +49 721 91374 8047
http://www.1und1.de

1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Hans-Henning Doerr, Ralph Dommermuth, Matthias 
Ehrlich, Andreas Gauger, Matthias Greve, Robert Hoffmann, Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren

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

Reply via email to