call "event.GetId()" in your generic callback and you will get the identifier of the control which posted the event.
···
From: Magnus Lycka <magnus@thinkware.se>
Reply-To: wxpython-users@lists.sourceforge.net
To: wxpython-users@lists.sourceforge.net
Subject: [wxPython] Absolute beginner...get who caused event
Date: Sun, 18 Feb 2001 01:35:10 +0100This is my first try with wxPython, and I haven't done
a lot of GUI programming (just GUI 'painting') before.I thought I'd make a little calculator, and thus I made
buttons with digits etc. These all call a frame method
self.OnPressMe through EVT_BUTTON.Then my thought was that OnPressMe(self, event) should
figure out which button was pressed, and then know
what to do.I could obviously make one call-back function for
each button, but I got this idea that I would be able
to use the text on the button and 'eval' to basically
make this program without coding...So, how does OnPressMe figure out which button was
pressed?/Magnus
<< magnus.vcf >>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users