MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
This is a re-post as I had no responses to the
original. I've included a little extra info I've
discovered.
I am porting an Image Archiving application to
wxPython as a learning exercise. I have a panel which
I am painting images to using the usual wxStaticBitmap
call on the image once converted to a BMP. This works
fine. However, to avoid image overlap I need to clear
the panel prior to each call to wxStaticBitmap. First
I tried what is used in lib/imagebrowser.py -
panel.SetBackgroundColour(wxColour(255,255,255))
followed by panel.Refresh() which achieved nothing.
After scouring the doco I tried panel.Clear() followed
by panel.Refresh() also with no luck. The code is
definitely being executed as it appears just prior to
the wxStaticBitmap call. My platform is Redhat Linux
7.1/Python 2.1.1/wxPython 2.3.1. Any suggestions as
to where I'm going wrong?
New Info: The panel is definitely storing all previous
images. When <ALT-TAB>ing between apps I can see the
images being painted over each other. wxLogMessage
definitely indicates only the expected single call to
display is made. I have also tried image.Destroy() to
discard old images (see code), but that only leads to
a core dump.
class Canvas(wxPanel):
def
__init__(self,parent,id,pos=wxDefaultPosition,size=wxDefaultSize,style=wxTAB_TRAVERSAL):
wxPanel.__init__(self,parent,id,pos,size,style)
self.img=NULL
def display(self,imgpath,point=wxPoint(0,0)):
#if self.img:
#self.img.Destroy()
self.img=wxImage(imgpath,wxBITMAP_TYPE_JPEG).ConvertToBitmap()
#self.SetBackgroundColour(wxColour(255,255,255))
#self.Clear()
wxLogMessage('Displaying %s' % imgpath)
wxStaticBitmap(self,-1,self.img,point,wxSize(self.img.GetWidth(),self.img.GetHeight()))
#self.Refresh()
···
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com