Re: GridBagSizer: Wrong cell size with colspan?

"'Pyfips' via wxPython-users" <[email protected]>
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
Hi Tim,

I see that it is difficult to figure out the "correct" / wanted sizes by 
the sizer. Maybe my expectation was wrong; for me it is a bit counter 
intuitive that the sizer stretches the third column, if I explicitly tell 
it to stretch the first one. Expecially as it will do so if I resize the 
dialog, for example.
I will try the size=(0, -1) workaround and see if I can calculate the min 
size of the dialog with respect to the contents of that panel.

Thank you for your advice!

On Friday, July 12, 2019 at 1:22:59 AM UTC+2, Tim Roberts wrote:
>
> 'Pyfips' via wxPython-users wrote: 
> > 
> > I thought, that self.AddGrowableCol(0, 1) would tell the sizer that 
> > the first column should grow in case it is too short (and not the 
> > third one). 
>
> Well, yes, but there's no reason to say that the first column is "too 
> short".  The first column is, in fact, exactly large enough to contain 
> its contents, as are the second and third columns. That's the problem.   
> Having the spanned content doesn't trigger any changes to the individual 
> columns. 
>
>
> > What I try to achieve is to write a generic dialog, so that the user 
> > can write the UI without caring about sizers, border etc. The 
> > GridBagSizer seemed ideal to me but that behaviour makes it difficult 
> > to keep the solution generic. 
>
> Right.  There's really no way to do a "generic" UI, because everyone has 
> a different idea of what the ideal layout is.  That's why there are so 
> many different sizers. 
>
>
> > Is there alternatively a way how I can recalculate the column sizes of 
> > the sizer and set them manually? I could not find any in the help file. 
>
> Well, how would YOU, as a human being, decide what needed to be done 
> here?  It's not at all obvious.  You have an idea in your mind of how it 
> should look, but what algorithm would you use to induce the grid to 
> produce that? 
>
> -- 
> Tim Roberts, [email protected] <javascript:> 
> Providenza & Boekelheide, Inc. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/5bc53e54-254a-4509-b345-51fd535daf85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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.