Issue with wxPython form Application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tomKeating
    New Member
    • Mar 2007
    • 2

    #1

    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.
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by tomKeating
    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.

    Comment

    • bartonc
      Recognized Expert Expert
      • Sep 2006
      • 6478

      #3
      By the way, welcome to the wxPython club on TheScripts' Python Forum!
      <shameless attempt to raise our google hit ration>

      Comment

      • tomKeating
        New Member
        • Mar 2007
        • 2

        #4
        Originally posted by bartonc
        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

        Comment

        • bartonc
          Recognized Expert Expert
          • Sep 2006
          • 6478

          #5
          Originally posted by tomKeating
          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.

          Comment

          Working...