473,378 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Newbie question: layout problems with wxPython

6
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:

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 1738
bartonc
6,596 Expert 4TB
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
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
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...
33
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...
3
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...
1
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...
3
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...
1
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
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...
6
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...
2
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
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...
0
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...

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.