I'm trying to create a simple frame containing a panel with a background
bitmap and a text control. While the text control is visible and can be
typed into it does not see mouse down or mouse drags. The code looks like:
from wxPython.wx import *
class CardFrame(wxFrame):
def __init__(self):
wxFrame.__init__(self, None, -1, "NotACard",
size = (320, 320),
style = wxDEFAULT_FRAME_STYLE |
wxNO_FULL_REPAINT_ON_RESIZE)
self.panel = wxPanel(self,1)
image = wxEmptyImage(80, 80)
bmp = image.ConvertToBitmap()
self.bitmap = wxStaticBitmap(self.panel, -1, bmp,
wxPoint(0, 0),
wxSize(bmp.GetWidth() * 4,
bmp.GetHeight() * 4))
self.text = wxTextCtrl(self.panel, -1, "",
wxPoint(50, 50), wxSize(200, 200),
wxTE_MULTILINE)
class MyApp(wxApp):
def OnInit(self):
frame = CardFrame()
frame.Show(true)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()
Reversing the creation of the text and bitmap controls leads to the text
being invisible (mostly - it appears when typing) but able to accept mouse
downs. Running Spy++ shows that a mouse down results in a WM_GETDLGCODE
message but no mouse messages. On windows normally window get all the mouse
events wherever they are visible but wxWindows seems to invert this so the
messages go to the wrong window.
Neil