Yes, 'resize' definitely works better. Thanks for the hint :)

Previous snippet (modified):
var win = new qx.ui.window.Window('Title');
win.addListener('resize', function(e) {
      var bounds = qx.core.Init.getApplication().getRoot().getBounds();
      this.set({
          width: bounds.width * 0.5,
          height: bounds.height * 0.5
      });
});
win.addListener('appear', this.center);




Sebastian Werner wrote:
> Just note that "appear" is post-layout and post-DOM. You might see the 
> window in the original dimensions first. Better is to use the resize 
> event. Can you test this as well and tell us if it works OK, too?
> 
> 
> Oleksiy Golovko schrieb:
>> Sebastian,
>>
>> Thanks for the explanation, I see the technical problem with it. So I 
>> think the best way to configure window dimensions relative to screen is 
>> to count them manually in the 'appear' handler. Here is the code snippet 
>> which might be useful for other developers having similar task:
>>
>> var win = new qx.ui.window.Window('Title');
>> win.addListener('appear', function(e) {
>>      var bounds = qx.core.Init.getApplication().getRoot().getBounds();
>>      this.set({
>>          width: bounds.width * 0.5,
>>          height: bounds.height * 0.5
>>      });
>>      this.center();
>> });
>>
>> Thanks,
>>      Oleksiy
>>
>>> No it is not. The question would also be what exactly should happen in 
>>> this case. Normally the mechanism which do the resize do not know 
>>> anything of the percents defined using the layout properties. Might not 
>>> give a clean solution for such a requirement.
>>>
>>> Sebastian
>>>
>>>> Thanks,
>>>>    Oleksiy
>>>>
>>>> Sebastian Werner wrote:
>>>>> Please also keep in mind that percent dimensions keep percent. So using 
>>>>> them might break the support for resizing and moving of such a window. 
>>>>> You can disable these if this is OK, otherwise mhh, you are maybe out of 
>>>>> luck for the moment.
>>>>>
>>>>> Sebastian
>>>>>
>>>>>
>>>>>
>>>>> Sebastian Werner schrieb:
>>>>>> Just saw you add it to the root of your application. If you use a 
>>>>>> traditional Standalone application you can define a percent width at the 
>>>>>> insertion time of the window as a so-named layout property e.g.
>>>>>>
>>>>>> app.getRoot().add(dlg, { width : "30%" });
>>>>>>
>>>>>> You may also double check that you have read this guide. It should 
>>>>>> explain these things in more detail:
>>>>>>
>>>>>> http://qooxdoo.org/documentation/0.8/ui_layouting
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Sebastian
>>>>>>
>>>>>>
>>>>>>
>>>>>> Sebastian Werner schrieb:
>>>>>>> Dimensions can only be given using pixels. Other dimension values 
>>>>>>> depend 
>>>>>>> on the layout you use inside the parent widget of the window.
>>>>>>>
>>>>>>> The HBox, VBox, Dock, Canvas layouts supports percent dimensions. But 
>>>>>>> all other do not. Where do you insert the window to?
>>>>>>>
>>>>>>> Sebastian
>>>>>>>
>>>>>>>
>>>>>>> Oleksiy Golovko schrieb:
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> I'm trying to set window dimensions using 'NN%'-like form without any 
>>>>>>>> success. The only effect I see is that "X"-close button got moved 
>>>>>>>> closer
>>>>>>>> to the window title text. Here steps to reproduce:
>>>>>>>>
>>>>>>>> var dlg = new qx.ui.window.Window('Error', null)
>>>>>>>>                  .set({
>>>>>>>>                      //width: '30%',
>>>>>>>>                      width: 1300,
>>>>>>>>                      maxWidth: 400,
>>>>>>>>                      height: 300,
>>>>>>>>                      modal: true,
>>>>>>>>                      useMoveFrame: true,
>>>>>>>>                      resizable: false,
>>>>>>>>                      allowMinimize: false,
>>>>>>>>                      allowMaximize: false,
>>>>>>>>                      showMaximize: false,
>>>>>>>>                      showMinimize: false,
>>>>>>>>                      contentPadding: 5
>>>>>>>>                  });
>>>>>>>> dlg.setLayout(new qx.ui.layout.Dock());
>>>>>>>>
>>>>>>>> ...
>>>>>>>> app.getRoot().add(dlg);
>>>>>>>>
>>>>>>>> Then in firebug:
>>>>>>>> dlg.open()
>>>>>>>> dlg.setWidth('10%')
>>>>>>>>
>>>>>>>> Should I fill the bug report or window dimensions are not supposed to 
>>>>>>>> be 
>>>>>>>>   used with percents?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>        Oleksiy
>>>>>>>>
>>>>>>>> -------------------------------------------------------------------------
>>>>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>>>>>> challenge
>>>>>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>>>>>> prizes
>>>>>>>> Grand prize is a trip for two to an Open Source event anywhere in the 
>>>>>>>> world
>>>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>>>>> _______________________________________________
>>>>>>>> qooxdoo-devel mailing list
>>>>>>>> [email protected]
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>>>> -------------------------------------------------------------------------
>>>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>>>>> challenge
>>>>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>>>>> prizes
>>>>>>> Grand prize is a trip for two to an Open Source event anywhere in the 
>>>>>>> world
>>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>>>> _______________________________________________
>>>>>>> qooxdoo-devel mailing list
>>>>>>> [email protected]
>>>>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>>> -------------------------------------------------------------------------
>>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>>>> challenge
>>>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>>>> prizes
>>>>>> Grand prize is a trip for two to an Open Source event anywhere in the 
>>>>>> world
>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>>> _______________________________________________
>>>>>> qooxdoo-devel mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>> -------------------------------------------------------------------------
>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>>> challenge
>>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>>> prizes
>>>>> Grand prize is a trip for two to an Open Source event anywhere in the 
>>>>> world
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> _______________________________________________
>>>>> qooxdoo-devel mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> qooxdoo-devel mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to