Hi,
For ofxButton I don't know, but for ofxToggle I just found this:
void ofApp::togglePressed( const void * sender, bool & pressed )
{
ofParameter<bool> * v = (ofParameter<bool> *)sender;
const string & name = v->getName();
...
}
Because the sender is not the ofxToggle, but the ofParameter which carry the toggle value. Luckily the ofParameter has the same name as the toggle.