I'm trying to create a background image on a wxFrame
and not having much luck. Below I have some code wich
adds an image and then some controls. The Controls
show up and are accessable via keyboard, but not mouse
clicks.Is there something I'm doing wrong? Is there a better
way?
Chris was right. You have a Z order problem; the buttons are underneath the
image. Try making the buttons children of the static bitmap:
from wxPython.wx import *
import stringclass MainWindow(wxFrame):
wxInitAllImageHandlers()
def __init__(self,parent,id,title):
wxFrame.__init__(self,parent,-4, title, size = ( 400,400),
style=wxDEFAULT_FRAME_STYLE)
bmp = wxBitmap('Winter.jpg', wxBITMAP_TYPE_JPEG)
staticBmpCtrl = wxStaticBitmap(self, -1, bmp, (0, 0))
button1 = wxButton(self, 10, "Hello", wxPoint(20, 20))
button2 = wxButton(self, 20, "goodby", wxPoint(200, 200))
Change that to:
button1 = wxButton(staticBmpCtrl, 10, "Hello", wxPoint(20, 20))
button2 = wxButton(staticBmpCtrl, 20, "goodby", wxPoint(200, 200))
and it should work.
ยทยทยท
On Thu, 11 Sep 2003 17:10:13 -0700 (PDT), Seth Shikora <sseth@rocketmail.com> wrote:
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.