473,795 Members | 3,215 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wxPython and window sizing

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.SplitterWind ow(self, -1)

curves = wx.Notebook(s)
curve = wx.Window(curve s, ID_BLANKCURVE, style=wx.SUNKEN _BORDER,
size=(300,200))
curves.AddPage( curve, "Blank")

textbox = wx.TextCtrl(s, ID_TEXTBOX, style=wx.TE_MUL TILINE,
size=(-1,50))

s.SetMinimumPan eSize(50)
s.SplitHorizont ally(curves, textbox)
s.SetSashGravit y(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
2 2058
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.SplitterWind ow(self, -1)

curves = wx.Notebook(s)
curve = wx.Window(curve s, ID_BLANKCURVE, style=wx.SUNKEN _BORDER,
size=(300,200))
curves.AddPage( curve, "Blank")

textbox = wx.TextCtrl(s, ID_TEXTBOX, style=wx.TE_MUL TILINE,
size=(-1,50))

s.SetMinimumPan eSize(50)
s.SplitHorizont ally(curves, textbox)
s.SetSashGravit y(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
In article <dg**********@n ews.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1412
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 when writing 'sizer' code, and I tend to spend quite some time before getting it correct. Some time ago I was going to implement a copy of a MFC based dialog in wxPython. The MFC dialog did not have dynamic sizing. In order to identify how the...
4
4341
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 full functionality of a frame (title,menu,status bars, min,max,close icons, scroll bars, sizing, moving). In addition, the user must be able to create grandchild frames within these child frames, to an arbitrary depth (in practice limited to 10...
15
2913
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 to be more low-level than the other GUI toolkits I've used (Tk, GTK, and Trestle), and there are all sorts exposed details in wxWindows/wxPython that I find weird.
18
2518
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. If a new window is already open, the new map sizes are ignored and the new map is is either too small for the existing "new" window or too big, which is a more serious problem! I've tried to fix this by closing the new window if it is already...
6
2405
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 features" discovered in the 2.6.3.0 release made last week. A summary of changes is listed below and at http://wxpython.org/recentchanges.php.
0
1314
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 features" discovered in the 2.6.3.0 release made last week. A summary of changes is listed below and at http://wxpython.org/recentchanges.php.
3
2548
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):
16
2417
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 in particular, but I am curious to know why some people find it "ugly" or "bad" or whatever. It has its own bugs and missing features, of course, but it is one of the major GUI player in the arena, together with PyQt and PyGTK.
0
1811
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 yield command just in the 8.6a3 release, but then I looked at wx.SafeYield code and apparently it is possible to replicate it. Here is an initial cut, it is very possible to contain something not equivalent to wx.SafeYield (besides it could be...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10438
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.