Getting a painted background in wxPython...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Che M
    New Member
    • Feb 2007
    • 7

    #1

    Getting a painted background in wxPython...

    Hello,

    I'm curious if it is easy to get panels on your wxPython apps to have backgrounds which are given by a jpg or other bitmap. I found http://www.5etdemi.com/blog/archives...d-in-wxpython/ on a blog, which seems to be the way to do it, but I am too new to Python and wxPython to understand how to implement it.

    Can anyone help me understand how to go from this to specifying an image to serve as the background to a panel? Of course I'll want the controls to show up over the panel, and not be obscured by the image.

    Also, are there wxPython-created example app screenshots out there?

    Thanks,
    Che
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by Che M
    Hello,

    I'm curious if it is easy to get panels on your wxPython apps to have backgrounds which are given by a jpg or other bitmap. I found http://www.5etdemi.com/blog/archives...d-in-wxpython/ on a blog, which seems to be the way to do it, but I am too new to Python and wxPython to understand how to implement it.

    Can anyone help me understand how to go from this to specifying an image to serve as the background to a panel? Of course I'll want the controls to show up over the panel, and not be obscured by the image.

    Also, are there wxPython-created example app screenshots out there?

    Thanks,
    Che
    Hey, Che! Great to have you join us! Sorry about the delay. My connection's been down all day.
    I'm going to take a look at the (fairly new wx lib module) ButtonPanel. I know that they do very cool things with the backgrounds. Some people miss the docs and demos download while they're at the site getting the core download. It is a highly recommend addition. Nearly all the things you can dream of doing are shown with very basic, well commented code.
    Welcome to TSDN!

    Comment

    • Che M
      New Member
      • Feb 2007
      • 7

      #3
      Thanks, Barton!

      I'll look at ButtonPanel too, though I am concerned that it is not quite right for making a large panel with other controls on it. What I was hoping for is to have the general background of the GUI have either a gradient or something like that, and then have all other controls on that colored panel (textboxes, choices, static text, whatever).

      Thanks again, glad to be here,
      Che

      Comment

      • bartonc
        Recognized Expert Expert
        • Sep 2006
        • 6478

        #4
        Originally posted by Che M
        Thanks, Barton!

        I'll look at ButtonPanel too, though I am concerned that it is not quite right for making a large panel with other controls on it. What I was hoping for is to have the general background of the GUI have either a gradient or something like that, and then have all other controls on that colored panel (textboxes, choices, static text, whatever).

        Thanks again, glad to be here,
        Che
        I haven't gotten to it yet, but I meant I'd take a look at the source code for that class and see what tricks they use to get the gradient background.

        Comment

        • bartonc
          Recognized Expert Expert
          • Sep 2006
          • 6478

          #5
          Originally posted by Che M
          Thanks, Barton!

          I'll look at ButtonPanel too, though I am concerned that it is not quite right for making a large panel with other controls on it. What I was hoping for is to have the general background of the GUI have either a gradient or something like that, and then have all other controls on that colored panel (textboxes, choices, static text, whatever).

          Thanks again, glad to be here,
          Che
          Hi, Che. I've looked at ButtonPanel. It turns out to be a MiniFrame subclass which is a subclass of Frame. So I think that all the gradient work exemplified there will work for you.

          Comment

          • Che M
            New Member
            • Feb 2007
            • 7

            #6
            Originally posted by bartonc
            Hi, Che. I've looked at ButtonPanel. It turns out to be a MiniFrame subclass which is a subclass of Frame. So I think that all the gradient work exemplified there will work for you.
            Thanks, Barton, I'll have a look at it. Overall it's been hard for me to settle on a good "look and feel" for the GUI I'm trying to make, and yet I believe the right look and intuitive layout is important. Whether a gradient may add a little visual texture to the look I'm not sure, but I'll try to play around with it.

            Thanks again,
            Che

            Comment

            Working...