[wxPython-users] Default Sizers, First Draft (was Re: [wxPython-users] Parent of wx.BoxSizer?)

Robin Dunn robin at alldunn.com
Thu Jun 1 10:27:16 PDT 2006


Alex Tweedly wrote:
> Kevin Ollivier wrote:
> 
>>
>> Hmmm... I'd been leaning against the gridbag only idea because I felt  
>> that it was simpler to just say, for example, "I want a horizontal  
>> sizer" rather than set/alter rows/columns to give the same effect.  
>> But actually, thinking about it more, perhaps the best way to do it  
>> would be to add 'shortcuts' for common scenarios. For example, we add  
>> a function to SizedPanel (or GridBagSizer) named SetLayoutStyle 
>> (aStyle) that takes values like "horizontal", "vertical", "grid" and  
>> configures the GridBagSizer to act like these sizers. Setting  
>> properties on the GridBagSizer manually would automatically switch  
>> the layout to "custom". We could even later add common templates,  
>> like "form" (which would create a two column layout). This would  
>> address Chris and Alex's ideas about adding commonly used layouts as  
>> new 'sizers'. In fact, if we have this sort of API, I'm not sure  
>> there really would be any reason to keep other sizer types around,  
>> would there? What do you think? Do you foresee any problems with this?
>>
> Beware that BoxSizers and FlexGridSizers support sizer.Hide(), but 
> GridBagSizer doesn't.
> 

If not then it is a bug that should be fixed.  Do you mean that calling 
Hide on the GridBagSizer itself doesn't hide the contents, or that a 
hidden subsizer doesn't affect the layout of a GridBagSizer.

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





More information about the wxpython-users mailing list