type comparison and wxpython

borris borris at grange.com
Mon Jul 10 02:43:12 EDT 2006


ive been trying to do a test for type with wxpython objects

like

passing in a wx.TextCtrl into

def XXX(obj)
 if type(obj) is type(self.Button)

I have to make an object self.Button to get its type.
as I tried   is type("wx.Button") which didnt work.

trouble is the button must have a parent, which appears on the frame (Ill 
try to get rid of it)

but I should be able to use text to set the type
Ive tried "wx._controls.TextCtrl" which didnt work

any hints welcome

btw Im newbie to python, coming from Java and I reckon its cool and sleek
and coming from java Swing, I reckon wxPython is probably better




More information about the Python-list mailing list