RE: Window size and position




I'm currently coding a small application. I want the main
window to remember its size and position every time it is
started.

I believe that's the job of the window manager...
That's why you can set a couple different names for your window.

I believed this, too. But it isn't done by the window-manager.

What window manager are you using?  Mine saves window positions just fine.  Actually, it does it a little too 
well sometimes...  I have a very small GTK+ application I wrote that pops up a small window with one checkbox 
and its associated label (there's also a fairly long tooltip attached to it).  But basically the window that 
pops up is about four centimeters long, by about one and a half high, and always pops up exactly where I left 
it last.  And there's no code anywhere to set the location of the window.


In my applications I use this code:

If you're going to do that, make it optional, and only restore its position manually if the user has chosen 
to do so.  Some users may even have their window manager set to purposely choose a new location for each 
window every time, based on where the other windows on the screen are located.  There will be people who are 
happy to let their window manager decide where to place the window each time they start your program (I only 
let it decide for programs it hasn't seen).


Fredderic

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]