Remember window size and position

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Remember window size and position

drtau-4
Is there an easy way to get an application window to remember its
size and position, so the next time the user opens it, it is the way
he left it?  Or do I need to manually store that info when he
exits the application (store the size and position in the registry?) and reset its size
and position the next time he starts up the application?
Thanks.


Reply | Threaded
Open this post in threaded view
|

Re: Remember window size and position

Stefan Schmiedl
On Tue, 15 Jan 2002 19:28:16 GMT, drtau <[hidden email]> wrote:
> Is there an easy way to get an application window to remember its
> size and position, so the next time the user opens it, it is the way
> he left it?  Or do I need to manually store that info when he
> exits the application (store the size and position in the registry?) and reset its size
> and position the next time he starts up the application?
> Thanks.
>

given the choice, I would steer clear of the registry and keep
the stuff in local files. this way you get well-behaved apps
that can easily be (un-)installed by dragging folders.

having said that, I would store positions and sizes somewhere
in the application and on exit write this object by means of
STBOutFiler onto a file, which will be read when the application
starts up next time. That's another thing which was much easier
than I thought, when I did it for the first time in Smalltalk.

s.


Reply | Threaded
Open this post in threaded view
|

Re: Remember window size and position

Ravi
[hidden email] (Stefan Schmiedl) wrote in message news:<a22aud$tvis1$[hidden email]>...

> On Tue, 15 Jan 2002 19:28:16 GMT, drtau <[hidden email]> wrote:
> > Is there an easy way to get an application window to remember its
> > size and position, so the next time the user opens it, it is the way
> > he left it?  Or do I need to manually store that info when he
> > exits the application (store the size and position in the registry?) and reset its size
> > and position the next time he starts up the application?
> > Thanks.
> >
>
> given the choice, I would steer clear of the registry and keep
> the stuff in local files. this way you get well-behaved apps
> that can easily be (un-)installed by dragging folders.
>
> having said that, I would store positions and sizes somewhere
> in the application and on exit write this object by means of
> STBOutFiler onto a file, which will be read when the application
> starts up next time. That's another thing which was much easier
> than I thought, when I did it for the first time in Smalltalk.
>
> s.

Check out the Ini files exercise by Louis Sumberg at

http://www.mindspring.com/~lsumberg/PersonalMoney/

Regards,
Ravi