[wx-dev] [all] should SetSize() respect size hints?

Robin Dunn robin at alldunn.com
Tue Feb 12 16:37:49 PST 2008


Vaclav Slavik wrote:
> Hi,
> 
> Vadim Zeitlin wrote:
>> ever used the possibility to set its maximal size anyhow. So what
>> about simply removing SetSizeHints(), SetMinSize() and SetMaxSize()
>> from wxWindow and only keeping them in wxTLW?
> 
> +1
> 
> But wxWindow::SetMinSize() is not entirely unused (I sometimes use it 
> myself to set control's minimal size if I want it larger than min 
> size), so perhaps it would be best to keep it, but implement it in 
> terms of wxSizer::SetItemMinSize() (and assert if there's no 
> associated sizer, because in that case, calling SetMinSize() doesn't 
> make sense).

That sounds like a good compromise, but there is still the case of how 
do you manage if the SetMinSize is called before an item is added to the 
sizer?  I suppose we can just say that you can't call SetMinSize until 
after the item is in a sizer, but there is also the case of passing an 
explicit size is passed to the widget's ctor.  Then that value, (or 
partial value, like (50,-1)) is set as the minsize, and that code will 
*always* happen before the item is added to a sizer.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wx-dev mailing list