|
In all the interface examples, callback methods are defined like this:
void myCallbackFunction (HISender pSender, HKEvent, pEvent) { ... }
How do you use HISender’s in the method? In normal programming languages, the sender in a callback is telling the method what interface widget/button/whatever triggered the callback.
So if I press a button in an interface to do something, and it triggers the callback, I assume I’m supposed to use pSender to determine what button was pressed. But I can’t seem to do anything with pSender in the method. And I don’t see any documentation at all (no surprise there) on how to use pSender. Like is pSender refering to the object? Or do the name of the button? What is it?
So does anyone know or have any clue at all about HISenders?
|
|
|
|
I’m messing around with this too right now. I think this is the way to get a Component out of the pSender.
FBComponent* lComp = FBGetFBComponent( (HIObject) pSender );
if (lComp && lComp->Is(FBButton::TypeInfo)) {
// Do stuff }
|
|
|
|
Ya, you are right. That is exactly the way to do it. Someone else I know showed me similar code.
|
|
|