Additional Note..
The frame is built using xrced, and when it is tested it correctly sizes on
screen (see correctly scaled .jpg attachment). When it is used in the
application the frames size is different (see incorrectly scaled.jpg
attachment). The xrced display code is what I am looking for as this is
auto sizing. Anyone know what it could be???
________________________________________
From: David Poundall [mailto:david.poundall@treatmentservices.co.uk]
Sent: 27 January 2008 11:50
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] Fitting a frame to its contents.
I am doing a multilingual (western only) application and will need to
enter text in small dialog windows on the fly but it would be really nice if
> the frame could resize to take into account new text lengths when a
different language is selected.
Thanks in advance
- David
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.12/1245 - Release Date: 26/01/2008
15:45
Thank you Mike, that all makes good sense, I will give it a go.
···
-----Original Message-----
From: Mike Driscoll [mailto:mdriscoll@co.marshall.ia.us]
Sent: 28 January 2008 15:32
To: wxPython-users@lists.wxwidgets.org
Subject: RE: [wxPython-users] Fitting a frame to its contents.
David,
> -----Original Message-----
> From: David Poundall [mailto:david.poundall@treatmentservices.co.uk]
> Sent: Sunday, January 27, 2008 6:44 AM
> To: wxPython-users@lists.wxwidgets.org;
> david.poundall@treatmentservices.co.uk
> Subject: RE: [wxPython-users] Fitting a frame to its contents.
>
> Additional Note..
>
> The frame is built using xrced, and when it is tested it
> correctly sizes on screen (see correctly scaled .jpg
> attachment). When it is used in the application the frames
> size is different (see incorrectly scaled.jpg attachment).
> The xrced display code is what I am looking for as this is
> auto sizing. Anyone know what it could be???
>
>
<snipped>
If you have all your controls (excluding the panel and frame) in a sizer
or sizers, then you should be able to call the Fit() method on your parent
sizer. Like this:
# where self can be an wx.App, wx.Frame or wx.Panel
sizer.Fit(self)
In my programs, I usually set my sizer to my panel:
self.panel.SetSizer(sizer)
Sometimes you'll need to mess with SetSizeHints(), but I'm never sure when
you actually need that function. I've also noticed that when using Fit(),
I'll need to set a minimum width for my TextCtrl if it doesn't display
correctly. I'm sure others on the list will have other tips... probably of
higher quality. Most of my wxPython stuff is run on Windows XP, although I
modded one of my most complex pieces with just a line or two to get it to
run on Ubuntu.
HTH
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.13/1246 - Release Date:
27/01/2008 18:39
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.17/1252 - Release Date: 30/01/2008
20:51