Newbie wxpython staticbitmap help please

janama austuff at gmail.com
Fri Jun 16 06:44:04 EDT 2006


Thanks Jean this now makes sense, really appreciate your time and
effort mate.

    def __init__(self, parent):
        self._init_ctrls(parent)
        self.t1 = wx.Timer(self)
        self.t1.Start(2000) # 2 seconds
        self.Bind(wx.EVT_TIMER, self.OnTest1Timer)

        self.OnTest1Timer(self)

    def OnTest1Timer(self, evt):

        if os.path.isfile('images/page1.txt'):
              print "ok file present"
              i = wx.Image('images/pageGreen.png',wx.BITMAP_TYPE_PNG)
              b1 = wx.BitmapFromImage(i)
              self.staticBitmap1.SetBitmap(b1)
        else:
              print "ok file present"
              i = wx.Image('images/pageGrey.png',wx.BITMAP_TYPE_PNG)
              b1 = wx.BitmapFromImage(i)
              self.staticBitmap1.SetBitmap(b1)

The above works a treat,

thanks again Jean

janama




More information about the Python-list mailing list