Some properties need to be initialized to work correctly. This is true 
for all dimension and location properties for example. These properties 
need their apply routine to be executed. Even for the initial value. You 
can do this by executing:

this.initWidth();
this.initHeight();

inside the constructor of such a class. Please be sure that one of the 
super classes isn't execute these lines already as this would mean an 
additional overhead. One execution per property is enough.

Sebastian


dperez schrieb:
> Hi,
> 
> With this 3rd form, I get same results as 2nd one:
> 
> qx.Class.define("Caja", {
>       extend : qx.ui.layout.BoxLayout,
>       properties: {
>               width: {
>                       refine: true,
>                       init: 'auto'
>               },
>               height: {
>                       refine: true,
>                       init: 'auto'
>               }
>       }
> });
> 
> I mustn't be understanding something about appearances and properties.
> 
> 
> dperez wrote:
>> Hi,
>>
>> I used to have this before:
>>
>> qx.Class.define("Box", {
>>      extend : qx.ui.layout.BoxLayout,
>>      construct : function(orientacion) {
>>              arguments.callee.base.apply(this, arguments);
>>              this.auto();
>>      },
>> });
>>
>> Now I have changed it to use a custom appearance:
>>
>> qx.Class.define("Box", {
>>      extend : qx.ui.layout.BoxLayout,
>>      properties: {
>>              appearance: {
>>                      refine: true,
>>                      init: 'caja'
>>              }
>>      }
>> });
>>
>> This is the 'caja' appearance:
>>
>>              'caja': {
>>                      style: function(states) {
>>                              return {
>>                                      width: 'auto',
>>                                      height: 'auto'
>>                              }
>>                      }
>>              },
>>
>> Why aren't they equivalent?
>> The 2nd one doesn't show boxes with an auto size.
>>
>> Thanks for any clarification.
>>
>> Regards
>> David
>>
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to