On 02/24/2012 09:41 AM, omrihar wrote:
> Hi,
>
> In the application I am developing I have to open a fair amount of windows.
> Since I do not want the windows to open by default on the top-left corner I
> added this.addListener("resize", this.center, this) to the creator of the
> windows.
> The problem with this approach is that whenever the user later resizes the
> windows
> they get centered, of course, which is NOT the behavior I want. I wouldThen why do you attach the listener to the "resize" event?! The "appear" event looks like a better candidate here. But a generic event might not be the best approach anyway, as the centering will take place whenever the event is fired, ie. also after the user might have re-arranged the windows by hand. If I get it right you are concerned with the initial placement when the window appears for the first time. Then I'd suggest you make this placement a one-time shot of the code that creates the window. T. > rather that > the window centered after it is opened (or better yet, centered in the x > axis and > not far from the top on the y axis). > > One way I found which works for at least one window, is to use > addListenerOnce > instead of addListener. The problem with this is that I have to nest three > of them > so that after all the initial size changes of the window it will be > centered. Of course > this is suboptimal and not general enough (I don't know if sometime I will > need four, > or if after two it will stop and the next time a user resizes the window it > will be > centered again). > > Is there a smart way to achieve what I want without resorting to such hacks? > > Thanks! > Omri > > -- > View this message in context: > http://qooxdoo.678.n2.nabble.com/New-window-placement-tp7314259p7314259.html > Sent from the qooxdoo mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
