Why does wxStaticBitmap display multiple images instead of one [Newbie alert]

K

Knoppix User

Hi everyone

I am working on a small app that loads a directory into a list, using

dirList = os.listdir(dirName)

The idea is that it then traverses the list, storing each filename in
curFile, and appending the directory:

curFile = dirName + '/' + dirList[dirListndx]

The image then is displayed using a call:

self.showJpg(curFile)

to the function showJpg:

def showJpg(self, fName):
#Display jpg to app
img = wxImage(fName, wxBITMAP_TYPE_JPEG)
imgSmall = img.Scale(200,200)
wxStaticBitmap(self, -1, wxBitmapFromImage(imgSmall), pos = (245, 60),
size= (100,100))

All works as planned, except that the image displayed, being correct,
first shows, in rapid succession, each of the prior showed images before
it halts at the appropriate curFile.

I have tried to debug it in BoaConstructor, and the inputs to showJpg are
appropriate. Am I using wxStaticBitmap incorrectly? Do I need to
initialize wxStaticBitmap, and if so, how?

Any help is much appreciated.

Steve
 

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top