MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use interface callback's HISender pSender?

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
384 Views, 2 Replies

How to use interface callback's HISender pSender?

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?
2 REPLIES 2
Message 2 of 3
Eiktyrner
in reply to: Anonymous

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
}
Message 3 of 3
Anonymous
in reply to: Anonymous

Ya, you are right. That is exactly the way to do it. Someone else I know showed me similar code.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report