Re: SetSize vs GetSize
Demetrios Tsillas <[email protected]> Wed, 24 Apr 2019 08:01:14 -0700 (PDT)
| Newsgroups | gmane.comp.python.wxpython.devel |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_946_1144715663.1556118074669 Content-Type: multipart/alternative; boundary="----=_Part_947_727775197.1556118074669" ------=_Part_947_727775197.1556118074669 Content-Type: text/plain; charset="UTF-8" Follow up: when I call GetSize OnStart I get x' - x = 0 and y' - y = 0 but when I call it OnClose I get x' - x = 6 and y' - y = 32. The problem is that I can't tell for the general case what those differences are since the user may have resized the window. On Wednesday, April 24, 2019 at 10:55:09 AM UTC-4, Demetrios Tsillas wrote: > > My app wants to remember its last geometry so it can restore itself to the > last position and size if it is restarted. > > So OnClose I GetSize and GetPosition and save the results in an init file. > > OnStart I read this init file and SetSize and SetPosition to restore the > geometry. > > But here's the problem: it appears every time I do this the window gets a > little bigger. > > The reason is that if I SetSize (x, y) and GetSize => (x', y') x' - x > 0 > and y' - y > 0. > > On Linux x' - x = 8 and y' - y = 32. > > Is there a natural way for me to do the right thing? > > I guess I can do the above math OnStart and use the differences to adjust > the saved values OnClose. > > Just wondering if there's a cleaner way. > > thanks!!! > -Jim. > > -- You received this message because you are subscribed to the Google Groups "wxPython-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. ------=_Part_947_727775197.1556118074669 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Follow up: when I call GetSize OnStart I get x' - x = =3D 0 and y' - y =3D 0 but when I call it OnClose I get x' - x =3D = 6 and y' - y =3D 32. The problem is that I can't tell for the gener= al case what those differences are since the user may have resized the wind= ow.<br><br>On Wednesday, April 24, 2019 at 10:55:09 AM UTC-4, Demetrios Tsi= llas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left= : 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">My= app wants to remember its last geometry so it can restore itself to the la= st position and size if it is restarted.<div><br></div><div>So OnClose I Ge= tSize and GetPosition and save the results in an init file.</div><div><br><= /div><div>OnStart I read this init file and SetSize and SetPosition to rest= ore the geometry.</div><div><br></div><div>But here's the problem: it a= ppears every time I do this the window gets a little bigger.</div><div><br>= </div><div>The reason is that if I SetSize (x, y) and GetSize =3D> (x= 9;, y') x' - x > 0 and y' - y > 0.</div><div><br></div><d= iv>On Linux x' - x =3D 8 and y' - y =3D 32.</div><div><br></div><di= v>Is there a natural way for me to do the right thing?</div><div><br></div>= <div>I guess I can do the above math OnStart and use the differences to adj= ust the saved values OnClose.</div><div><br></div><div>Just wondering if th= ere's a cleaner way.</div><div><br></div><div>thanks!!!</div><div>-Jim.= </div><div><br></div></div></blockquote></div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;wxPython-dev" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:[email protected]">wxPyth= [email protected]</a>.<br /> For more options, visit <a href=3D"https://groups.google.com/d/optout">http= s://groups.google.com/d/optout</a>.<br /> ------=_Part_947_727775197.1556118074669-- ------=_Part_946_1144715663.1556118074669--