By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

wxPython and window sizing

P: n/a
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

--
Ville Voipio, Dr.Tech., M.Sc. (EE)

Sep 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Sep 15 '05 #2

P: n/a
In article <dg**********@news.hispeed.ch>, Franz GEIGER wrote:
Couldn't you register for a handler?


Oui, mais...

I can figure out a few ugly workarounds. However, my question is if
there is a nice and clean way to make wxPython set the minimum size.
I'd really hate to start calculating the sizes myself or making
any extra handlers, if the existing infrastructure can handle what
I want.

- Ville

--
Ville Voipio, Dr.Tech., M.Sc. (EE)

Sep 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.