473,665 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wxPython problem switching between 2 wx.SplitterWind ow's

I have posted this problem also on the wxpython-users list, but maybe
someone here can also help.

I want to keep 2 different views for the same object, both views using
SplitterWindow. So I am trying to create 2 SplitterWindow' s, keeping both
in memory, and alternately show only one of them. However, that doesn't
work and I've tried all kinds of combinations of Show, SplitVertically ,
UpdateSize, and Layout.

I think I have isolated the problem in this code snippet (also attached).
This code actually works. But un-comment the 2 lines for splitter2 and you
will see the problem:
#!/usr/bin/env python
import wx

class myFrame(wx.Fram e):
def __init__(self, parent):
wx.Frame.__init __(self,
parent=parent)
self.SetClientS ize(wx.Size(600 , 500))
self.splitter1= wx.SplitterWind ow(self)
self.splitter1. Hide()
#self.splitter2 =wx.SplitterWin dow(self) # un-comment and you'll
#self.splitter2 .Hide() # see the problem
def showSplitter(se lf, id):
if id==1:
self.splitter1. Show()
if id==2:
self.splitter2. Show()

class myApp(wx.App):
def OnInit(self):
wx.InitAllImage Handlers()
self.mainWin = myFrame(None)
self.mainWin.Sh ow()
self.SetTopWind ow(self.mainWin )
self.mainWin.sh owSplitter(1)

return True

if __name__ == '__main__':
application = myApp(0)
application.Mai nLoop()

I have cut it down to the bone, so there are no children in the
SplitterWindow' s and they are not even splitted. I assure you that the same
is happening in those cases. I am not invoking any Layout( ) here, but I've
tried that too.

Can anyone explain what is happening here? Am I missing a step somewhere?
Or could this actually be a bug in SplitterWindow?

Dan
Jul 18 '05 #1
0 1402

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3188
by: Rick Muller | last post by:
I have a problem that I would like to get some advice on from other Pythonistas. I currently manage a (soon to be) open source project for displaying molecular graphics for a variety of different programs. To do this I need to draw pictures of the molecules, typically using OpenGL, and do some basic control, using some widget set. The code currently uses GTK, and runs on Macintosh OS X under Fink, and Linux. I would like to support the...
1
1840
by: Gabriele Farina *DarkBard* | last post by:
Hi, there is a way to handle images directly from wxPython? I'd like to manage simple image handling, like drawing only a portion of an image, switching between two colors or drawing only some pixels. there's a way to do it? bye
5
10658
by: fooooo | last post by:
This is a network app, written in wxPython and the socket module. This is what I want to happen: GUI app starts. User clicks a button to 'start' the work of the app. When start is pressed, a new thread is spawned (threading module) and this thread starts listening for data on a socket. When someone connects, a new thread is spawned, It needs to do I/O on that socket and open a GUI window so the user can communicate with the client...
2
2053
by: Ville Voipio | last post by:
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,
9
2764
by: amhoov | last post by:
Hi all, I'm trying to install wxPython on Debian using 'apt-get install python-wxgtk2.4.' I've got both Python 2.3 and 2.4 installed with 2.4 set as my default. For whatever reason, wxPython always installs under /usr/lib/python2.3/site-packages. Does anyone know how I can force it to install in 2.4's site-packages directory?
1
2266
by: kath | last post by:
Hello, sorry about the lengthy message. I finding difficult to execute this program. The wx.Notebook i created is coming on the splitted frame(self.p2). How do I that. I am started to learn wxPython, and when I run the code, the code doesnot close gracefully, it throughs me an error. "pythonw.exe has encountered a problem and needs to close. We are sorry for the inconvenience"
1
2304
by: w.p. | last post by:
Hello! I have some trouble with my GUI. I have left panel with foldpanelbar, but i need one item but not collapsed - simple button. I split my left panel into two foldpanelbars with one button between. But a have trouble... Sorry for english :/ Simple code:
2
1412
by: shuf | last post by:
Hello, I am running python 2.4.4 with wxpython 2.6 on Fedora 6. I am just playing around with the splitterwindow, and I noticed some strange behavior when resizing the window using the cursor (using the example here). When I try to resize the window horizontally the sash will remain "ghosted" until I move the splitter up or down. I have been able to reduce the ghosting effect by changing the gravity and the size, but I cannot eliminate it...
2
1749
by: BjornB | last post by:
Hi! I'm totally new to Python and I'm jus nw trying to create my first application with wxPython, exciting! However, I have a problem: I'm creating a Frame with a menu and buttonpanel (wx.lib.buttonpanel), then below this I want to have I splitter window, more or less like the file explorer in Windows. This is (some of) my code:
0
8348
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
8863
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
8636
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
7376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4186
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
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.