wxPython and window sizing

Franz GEIGER fgeiger at datec.at
Thu Sep 15 09:47:43 EDT 2005


Ville Voipio wrote:

> I have a small problem; I would like to have a reasonable
> minimum size for a wx.Window.
> 
> A simplified version of my code:
> 
> 
>         s = wx.SplitterWindow(self, -1)
> 
>         curves = wx.Notebook(s)
>         curve = wx.Window(curves, ID_BLANKCURVE, style=wx.SUNKEN_BORDER,
>                           size=(300,200))
>         curves.AddPage(curve, "Blank")
> 
>         textbox = wx.TextCtrl(s, ID_TEXTBOX, style=wx.TE_MULTILINE,
>                               size=(-1,50))
> 
>         s.SetMinimumPaneSize(50)
>         s.SplitHorizontally(curves, textbox)
>         s.SetSashGravity(0.8)
> 
> 
> Here 'self' is the main window class, i.e. inherited from wx.Frame.
> 
> What I would like to happen is that both the curve area and the
> textbox would have an absolute minimum size when moving the
> sash or resizing the window.
> 
> How to get this behaviour? I have tried setting the minimum sizes
> of the curve and the textbox by using the SetMinSize() method,
> but this does not seem to affect anything.
> 
> Already when the window is shown the upper pane (i.e. the notebook
> curves) is smaller than (300,200) set in the code.
> 
> TIA,
> 
> - Ville
> 


Couldn't you register for a handler? It would be called on changing size or
on moving the sash's slider. And w/i that handler you could resize the
window to its min dims.

HTH
Franz GEIGER








More information about the Python-list mailing list