Re: How to specify what determines width of main frame when starting?

Carsten Grohmann <[email protected]>
Newsgroups gmane.comp.python.wxglade
Message-ID <[email protected]>
Hi Chris,

Chris Green schrieb am 14.02.2016:
> On Sun, Feb 14, 2016 at 09:33:42AM -0500, Igor Korot wrote:
> > Hi,
> > 
> > On Sun, Feb 14, 2016 at 7:44 AM,  <[email protected]> wrote:  
> > > I'm actually getting to design something now!  :-)
> > >
> > > Thanks for the help so far.
> > >
> > > I have a fairly simple layout that comprises a grid sizer with a 3
> > > wide by 2 high collection of date controls, text controls and
> > > static text as the top 1/3rd of my main window.  Then the bottom
> > > 2/3 of the main frame is a grid.
> > >
> > > How do I make things so that the width of the grid sets the width
> > > of the frame?  At the moment it starts up with the frame width
> > > set to the size determined by the width of the three grid sizer
> > > controls, the grid thus has an unnecessary horizontal scroll
> > > bar.  Even if I make the window wider the grid stays the same
> > > width (with a scroll bar) and there's just a big space to its
> > > right.  
> > 
> > Did you add some columns to the grid?
> >   
> Yes, it has 8 columns with explicit column titles.
> 
> It seems that the grid sizer at the top overrides the width of the
> grid in the sizer below it.  (Originally I had the grid at the bottom
> directly in the main frame's top level sizer but I've moved it into a
> box sizer of its own, made no difference).
> 
> If I set the hgap for the grid sizer then it spreads it out and makes
> the window wide enoough for the grid at the bottom but surely it
> should be possible to make the window size itself to the widest
> element in the frame rather than the first element which is what it
> appears to do at the moment.
> 
> Maybe this is a wxwidgets issue rather than a wxglade one, I don't
> know. 

The wx layout engine works fine generally. Mostly if I had such kind of
trouble, my used settings especially propotion and alignment
(wxEXPAND?) were incorrect.

>From my perspective this wiki page
http://wiki.wxpython.org/BoxSizerFromTheGroundUp is very helpful for
explaining handling sizers.

Regards,
Carsten

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.