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

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top