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) 2 2026
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
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) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Nikolai Kirsebom |
last post by:
I've made a small utility which converts the content of a Microsoft
Word2000 document to wxPython code.
For some time I've used wxPython in small projects. I always have to
look up old examples...
|
by: Simon Erikson |
last post by:
Hello:
I would like to build an app consisting of a "root" frame that can
contain an arbitrary number of child frames (the user will click to
create them). Each of these child frames needs the...
|
by: Grant Edwards |
last post by:
Can anybody recommend a good book on wxPython? Are there any
books on wxPython?
I've been trying to learn wxPython and/or wax for a few weeks,
and I'm just not getting it.
wxWindows seems...
|
by: Roger Withnell |
last post by:
I open a new window from the current window to display maps.
Several maps of different sizes can be displayed. The function is given the
size of the map and adjusts the window size accordingly....
|
by: Robin Dunn |
last post by:
Announcing
----------
The 2.6.3.2 release of wxPython is now available for download at
http://wxpython.org/download.php. This is a mostly bug fix release
and takes care of several "unfortunate...
|
by: Robin Dunn |
last post by:
Announcing
----------
The 2.6.3.2 release of wxPython is now available for download at
http://wxpython.org/download.php. This is a mostly bug fix release
and takes care of several "unfortunate...
|
by: citronelu |
last post by:
Hi,
I'm new to wxpython, and the following code is my first serious
attempt:
#~ start code
import wx
class MyPanel(wx.Panel):
|
by: Andrea Gavana |
last post by:
Hi Diez & All,
Do you mind explaining "why" you find it *buttugly*? I am asking just
out of curiosity, obviously. I am so biased towards wxPython that I
won't make any comment on this thread...
|
by: Guilherme Polo |
last post by:
On 10/29/08, Olrik Lenstra <o.lenstra@gmail.comwrote:
It will be a combination of commands, not a single one. Initially I
considered this as "probably without solution", since tcl acquired a...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |