Re: SetSize vs GetSize

Demetrios Tsillas <[email protected]> Wed, 24 Apr 2019 08:10:48 -0700 (PDT)
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>
------=_Part_941_1093505383.1556118648551
Content-Type: multipart/alternative; 
	boundary="----=_Part_942_622514704.1556118648551"

------=_Part_942_622514704.1556118648551
Content-Type: text/plain; charset="UTF-8"

Nevermind I just discovered GetClientSize/SetClientSize which do what I 
want.

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_942_622514704.1556118648551
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Nevermind I just discovered GetClientSize/SetClientSize wh=
ich do what I want.<br><br>On Wednesday, April 24, 2019 at 10:55:09 AM UTC-=
4, Demetrios Tsillas wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr">My app wants to remember its last geometry so it can restore =
itself to the last position and size if it is restarted.<div><br></div><div=
>So OnClose I GetSize and GetPosition and save the results in an init file.=
</div><div><br></div><div>OnStart I read this init file and SetSize and Set=
Position to restore the geometry.</div><div><br></div><div>But here&#39;s t=
he problem: it appears 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 GetSi=
ze =3D&gt; (x&#39;, y&#39;) x&#39; - x &gt; 0 and y&#39; - y &gt; 0.</div><=
div><br></div><div>On Linux x&#39; - x =3D 8 and y&#39; - y =3D 32.</div><d=
iv><br></div><div>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 di=
fferences to adjust the saved values OnClose.</div><div><br></div><div>Just=
 wondering if there&#39;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&quot; 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_942_622514704.1556118648551--

------=_Part_941_1093505383.1556118648551--