Refresh()

Duncan Smith buzzard at urubu.freeserve.co.uk
Mon Feb 18 21:03:34 EST 2002


I am having problems with the following wxPython code.  I simply want to
change the background colour of 'panel1' and then (re)draw to 'panel1'.  For
some reason it does not redraw (but I can redraw by calling the
OnGraphviewMove(event) function again, eg. by moving the window).  Maybe I
just need a decent explanation of exactly what Redraw() does?  Can anyone
please help?  Thanks in advance.  (Win2000, Python 2.1, wxPython 2.2.?.)

Duncan Smith


    def OnToolbar1tools4Tool(self, event):
        data = wxColourData()
        data.SetChooseFull(true)
        dlg = wxColourDialog(self, data)
        try:
            if dlg.ShowModal() == wxID_OK:
                data = dlg.GetColourData()
                self.panel1.SetBackgroundColour(data.GetColour())
                self.panel1.Refresh()                   #change the
background
                self.OnGraphviewMove(event)    #(re)draw the graphic
        finally:
            dlg.Destroy()






More information about the Python-list mailing list