473,569 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Newbie question: layout problems with wxPython

6 New Member
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.buttonp anel), 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:

Expand|Select|Wrap|Line Numbers
  1.  
  2. wx.Frame.__init__(self, parent, -1, title,
  3.           style = wx.DEFAULT_FRAME_STYLE | wx.MAXIMIZE | wx.NO_FULL_REPAINT_ON_RESIZE)
  4.  
  5.  
  6. self.MyPanel = wx.Panel(self, style = wx.MAXIMIZE )
  7. self.MyMenu = MyMenu(self)
  8.  
  9. self.MyButtonPanel = MyButtonPanel(self.MyPanel)
  10.  
  11. splitter = wx.SplitterWindow(self.MyPanel, -1, size = (3000, 2000), style = wx.SP_LIVE_UPDATE)
  12.  
  13. sty = wx.BORDER_SUNKEN | wx.MAXIMIZE
  14.  
  15. p1 = wx.Window(splitter, style=sty)
  16. p1.SetBackgroundColour("white")
  17. wx.StaticText(p1, -1, "Panel One", (5,5))
  18.  
  19. p2 = wx.Window(splitter, style=sty)
  20. p2.SetBackgroundColour("white")
  21. wx.StaticText(p2, -1, "Panel Two", (5,5))
  22.  
  23. splitter.SetMinimumPaneSize(20)
  24. splitter.SplitVertically(p1, p2, 200)
  25.  
  26.  

My first question is about layout, I think I have missed something important. The Frame and menu looks good, but the buttonpanel and the splitter start in the same point, just below the menu. How can I tell he splitter to start where the buttonpanel ends (in the y direcion)? I'm not sure how to layout the different objects so that it looks good, so that they will not overlap.

The other question is about the size of the splitter, now it is (3000, 2000), just to be sure to always not be smaller than the screen. I didn't suceed to get the screen size to set that size nor did I find any attribute MAXIMIZE or similar.

I'm running python version 2.5.

Thanks in advance!
Björn
Jun 12 '07 #1
2 1747
bartonc
6,596 Recognized Expert Expert
Although I've been using wxPython for about a year now, I can't tell by looking what's going on. The reason is that I don't write the GUI part of my apps. I use a tool (referred to as a GUI generator) which lets me arrange graphical objects on the screen and forget about the details. If you are familiar with MS visual anything, you'll know what I'm talking about.

If you are interested, I'll bet that we could find you a tool that suits your needs.
Jun 13 '07 #2
BjornB
6 New Member
Hi!

I'll have a look into the kind of tools that you are talking about, even tough I found the problem (I spent a lot of time reading code, uhg). What I was looking for was a sizer to have a nice layout. Then I simply added the splitter to the sizer object and it looks good.

Thanks!
Björn
Jun 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
1902
by: glutinous | last post by:
I've looked at manuals and experimented until my brain's oozing out of my ears, and I still can't figure out what I anticipate will prove to be fairly basic css layout knowledge. I'd be amazed if this was the first (or even if only the 100th) time someone has asked about this sort of situation. So I apologise, not least for the awkwardness...
33
3112
by: John Timbers | last post by:
I'd like to purchase Visual C# .Net for learning purposes only since it's a lot cheaper than Visual Studio (note that I'm a very experienced C++ developer). Can someone simply clarify the basic differences. Ok, Visual Studio has C++, VB and J++ thrown in plus some extra bells and whistles (I already have some minimal experience) but are both...
3
3488
by: Young H. Rhiu | last post by:
See: http://hilug.org/img/app_layout.GIF I'm implementing an album-like application with wxpython but I'm new to wxPython though I know how to program with python. The problem is that it's not easy for me to deal with drawing layout stuff with wxpython. What layout I'm thinking of looks like the gif image above. The application is about...
1
1898
by: py | last post by:
I have the following code: class MainFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, wx.ID_ANY, title, style=wx.DEFAULT_FRAME_STYLE |wx.NO_FULL_REPAINT_ON_RESIZE) # build top area topSizer = self.buildTopPanel() # build input area inputSizer = self.buildInputPanel()
3
1720
by: writeson | last post by:
Hi all, I'm trying to use wxPython from a fairly new installation of Fedora Core 5. I installed wxPython using yum -y install wxPython and that all seemed to work fine. However, when I run Python and do this: import wx I get this:
1
2208
by: nelson - | last post by:
Hi all, i'm developing an application that uses Floatcanvas to diplay a cartesian plane. how can i embed it into a "complex" layout? I have this controls MENUS TOOLBAR NOTEBOOK
3
2300
by: Soren | last post by:
Hi, Id like to make my own special listbox.. I want to able (at the push of a button) to add another item to my special listbox... each item is a panel with a label, some buttons and maybe a text control. I've tried adding a new panel object with the stuff i want to the sizer i'm using for my listbox (which is a panel which can contain...
6
1129
by: LessPaul | last post by:
I recently discovered Python and see it as a great language to use for personal projects (and more). I made my living for over a decade as a coder in C, C++, ADA, Fortran, and Assembly before moving to systems engineering. I'm now retired, and would love to code again. I see Python as the perfect language to get a good program working in a...
2
1117
by: Andy | last post by:
I want to dynamically update a list of elements shown as a checkbox list. A file is used to store the elements, and elements can be added and deleted from the list. The trouble is that the window is not properly updated after deleting/adding items. I use the Detach()/Destroy() to remove the sizer, and then I create a new and updated sizer...
0
7693
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...
0
7605
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...
1
7665
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...
0
6277
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...
1
5501
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...
0
5217
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...
0
3651
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...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
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.