Wxpython refresh images in wxpython staticbitmap

I need your help to update and modify staticbitmap images in wxpython without overlapping each other, I am creating a slotmachine program in python, but I have a problem stacking staticbitmaps on top of each other when I spin the slotmachine wheel to display the images .. see below picture, thanx in advance.

Screenshot here -> http://s2.postimg.org/434h21t2x/problem.png

wheel_faces = controller.show_wheel_faces()

            image_list = {"CHERRY":"resources/cherry.png", "ORANGE":"resources/orange.png", 
                         "7":"resources/seven.png", "COIN":"resources/coin.png", 
                         "CLOWN":"resources/clown.png", "APPLE":"resources/apple.png"}

            if wheel_faces != []:
                #print wheel_faces
                wheel1 = wx.EmptyImage()
                wheel1 = wx.Image(image_list.get(wheel_faces[0]), 
wx.BITMAP_TYPE_PNG).ConvertToBitmap()
                wx.StaticBitmap(self, -1, wheel1, pos=(135, 272))


                wheel2 = wx.Image(image_list.get(wheel_faces[1]), 
wx.BITMAP_TYPE_PNG).ConvertToBitmap()
                wx.StaticBitmap(self, -1, wheel2, pos=(276, 272))

                wheel3 = wx.Image(image_list.get(wheel_faces[2]), 
wx.BITMAP_TYPE_PNG).ConvertToBitmap()
                wx.StaticBitmap(self, -1, wheel3, pos=(415, 272))
                self.Refresh()

                self.account_balance += int(controller.show_winnings())

                if controller.show_winnings() != 0:
                    self.payout_label.SetLabel(str(self.account_balance))

                self.spin_label.SetLabel(str(controller.show_winnings()))
                #print controller.balance_manager()
                self.Refresh()

      

+3


source to share





All Articles