Hello,
I am having an issue with wxPython toolkit. I am using a wx.GridSizer object to place a grid displaying some status info. I need to update this grid, and so I came up with a few different ways of doing it. The one I prefer is to simply refresh/update the text that needs the updating, so I could try detaching the wxStaticText object from the sizer, overwriting it with a new wxStaticText object, and inserting the object back into the sizer at its previous index.
The better way, is to use the parent class of wxGridSizer,wxSizer, which has a method called 'Replace' which will allow me to replace the item in the widget without taking it out, and inserting it back in. Much more slick no? Well I get a very odd error when attempting to use this method. Here is code followed by error:
self.info_sizer.Replace(self.project_value, wx.StaticText(self, wx.ID_ANY, project))
self.info_sizer.Replace(self.project_value, wx.StaticText(self, wx.ID_ANY, project))
AttributeError: 'GridSizer' object has no attribute 'Replace'
So suddenly Replace is not an option. Bear in mind that the Insert method I refered to earlier is a method of the sizer's parent class wxSizer. So there proves that the sizer im using, wxGridSizer, can successfully call its parent class's method (inherited, subclassed) Insert.
So why cant I call in a similar way the method Replace?