Hi

I had same problems with a window widget which I used for login. So I guess at 
the rendering state of qx their are not every property finally computed. But 
your main function will be executed parallel to the framework initial and 
render functions. So the easiest method is to use a little timeout function to 
put your login dialog to the end of queued processes. 

P. S. Delete every work around code for proper use, dialog widget is auto 
centering in default behavior. 

Regards Mustafa Sak

Von meinem iPhone gesendet

Am 03.02.2011 um 02:59 schrieb bplturner <[email protected]>:

> 
> Hello,
> 
> I'm using the Dialog contribution to create a login window, but I cannot get
> the thing to center in the page and it's frustrating me.  I changed the
> image to a slightly bigger one, and if I resize the page it'll center, but
> it won't center when I initially render it.
> 
> Here is my code:
> 
> createLogin : function()
>  {
>    var loginWidget = new dialog.Login({
>      image       : "foo_small.gif", 
>      text        : "Welcome to Foofoo..",
>      callback    : this.loginCallbackFunc,
>      context     : this,
>      maxWidth    : 600
>    });
>    loginWidget.addListener("loginSuccess", function(e){
>      dialog.Dialog.alert( "You are now logged in. Or at least we pretend."
> );
>    });
>    loginWidget.addListener("loginFailure", function(e){
>      dialog.Dialog.alert(e.getData());
>    });
>    var self = this;
>    loginWidget.addListener("registerRequest", function(e) {
>      self.registerWizard();
>    });
>    qx.ui.core.queue.Manager.flush();
>    loginWidget.setAlignX("center");
>    loginWidget.setAlignY("center");
>    var bounds = loginWidget.getBounds();
>    loginWidget.set({
>      marginTop: Math.round( ( qx.bom.Document.getHeight() -bounds.height )
> / 2),
>      marginLeft : Math.round( ( qx.bom.Document.getWidth() -bounds.width) /
> 2)
>    });
> 
>    loginWidget.show();
>  },
> 
> I tried setAlign and also by setting the margins manually, but that doesn't
> work.  I tried loginWidget.center() but that's not supported.  Can anyone
> assist?  It's about 100 pixels off from center and it's driving me nuts. 
> Thank you.
> 
> It's invoked with a simple createLogin(); from the main function.
> -- 
> View this message in context: 
> http://qooxdoo.678.n2.nabble.com/Centering-Window-with-Dialog-Contribution-tp5987271p5987271.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
> February 28th, so secure your free ArcSight Logger TODAY! 
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to