I'm trying to display an image in a window, but the 'wxWindow.Refresh()'
method doesn't seem to be issuing a Paint event. All the methods in my
ImageWindow class get called except for the 'OnPaint' event handler.
Please help.
Thanks in advance,
Carl
···
---------------------------------------------
class ImageWindow(wxWindow):
def __init__(self, parent, ID):
wxWindow.__init__(self, parent, ID)
self.image = None
def SetImage(self, image):
self.image = image
self.Refresh(true)
def OnPaint(self, evt):
myDC = wxPaintDC(self)
if self.image:
myDC.DrawBitmap(self.image.ConvertToBitmap(), 0, 0, false)
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users
Robin
December 11, 2000, 5:11am
2
I'm trying to display an image in a window, but the 'wxWindow.Refresh()'
method doesn't seem to be issuing a Paint event. All the methods in my
ImageWindow class get called except for the 'OnPaint' event handler.
Please help.
Thanks in advance,
Carl
---------------------------------------------
class ImageWindow(wxWindow):
def __init__(self, parent, ID):
wxWindow.__init__(self, parent, ID)
self.image = None
Add this here:
EVT_PAINT(self, self.OnPaint)
···
def SetImage(self, image):
self.image = image
self.Refresh(true)
def OnPaint(self, evt):
myDC = wxPaintDC(self)
if self.image:
myDC.DrawBitmap(self.image.ConvertToBitmap(), 0, 0, false)
--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users