469,268 Members | 996 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,268 developers. It's quick & easy.

Issue with wxPython form Application

First I am new to both python and wxPython. I have developed a couple of applications for myself with Paradox, but it is time to move on.

I am having difficulty creating a solid background for a flatNotebook widget. I have a page that uses a flexBagSizer to display about 40 pieces of information. For those that I have no further use for I use a staticTextBox, for those I want to be able to present more information for (drill down) I use a wx.button. Using the defaults I created the form I want.

Where I'm having trouble is trying to make it look nice. I am trying to present a consistent color scheme. My problem is in creating a solid looking background.
first I tried using the colorPanel used in several demos, this seemed to work well but for some reason only the staticText widgets are visible, the buttons are covered by the colorPanel and I couldn't figure out how to make them visible.

So then I tried going back to the default page and adding the panels directly to empty grid cells, using background colors on the widgets. This also seemed to work until I realized that the background doesn't fill the cell it form fits the text and even if I pad the text for the horizontal space the background leaves default grey vertical lines as it doesn't fill all the space.

Can anyone help me with this. I would prefer the first, making the buttons visable on the grid with the colorPanel (allot less code) but if that doesn't work some way of filling in the background color on a grid cell with a control in it will work as well.
Mar 23 '07 #1
4 1926
bartonc
6,596 Expert 4TB
Where I'm having trouble is trying to make it look nice. I am trying to present a consistent color scheme. My problem is in creating a solid looking background.
first I tried using the colorPanel used in several demos, this seemed to work well but for some reason only the staticText widgets are visible, the buttons are covered by the colorPanel and I couldn't figure out how to make them visible.
This sounds like a creation order issue. Objects in wxPython are layed down in the order that they are created it. If the color panel goes down (is created) before all other widgets, they should end up bing visible. I've had a little difficulty in this regard with other combinations of widgets, so it's no perfect. If it seems very wrong, perhaps you'd like to post a bug report with the wxWidgets guys.
Mar 23 '07 #2
bartonc
6,596 Expert 4TB
By the way, welcome to the wxPython club on TheScripts' Python Forum!
<shameless attempt to raise our google hit ration>
Mar 23 '07 #3
This sounds like a creation order issue. Objects in wxPython are layed down in the order that they are created it. If the color panel goes down (is created) before all other widgets, they should end up bing visible. I've had a little difficulty in this regard with other combinations of widgets, so it's no perfect. If it seems very wrong, perhaps you'd like to post a bug report with the wxWidgets guys.

Thanks, I'm not sure exactly. Using the FlatNotebook page with background color set worked the way I wanted using the colorpanel from the examples did not. I think it might if I had put the gridbagsizer in a boxsizer first rather than on the notebook page as the colorpanel wouldn't accept the sizer. Anyway, your comment helped by making me think about how and when the items were placed on the form
Mar 26 '07 #4
bartonc
6,596 Expert 4TB
Thanks, I'm not sure exactly. Using the FlatNotebook page with background color set worked the way I wanted using the colorpanel from the examples did not. I think it might if I had put the gridbagsizer in a boxsizer first rather than on the notebook page as the colorpanel wouldn't accept the sizer.
Sounds about right.
Anyway, your comment helped by making me think about how and when the items were placed on the form
That's mighty important. Glad to be of some help.
Mar 26 '07 #5

Post your reply

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

Similar topics

15 posts views Thread by Grant Edwards | last post: by
25 posts views Thread by BJörn Lindqvist | last post: by
reply views Thread by Robin Dunn | last post: by
2 posts views Thread by nelson | last post: by
1 post views Thread by Marcin Kalicinski | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.