Custom event parameters

Discussion of features and help with problems encountered while using libRocket

Custom event parameters

Postby aquawicket on Fri Mar 20, 2015 9:57 pm

I'm attempting to Dispatch an event with a custom string parameter.
When I receive the event, I'm not able to get the parameter from the event.
Is there an appropriate way to do this?

DispatchEvent
Code: Select all
Rocket::Core::Dictionary parameters;
parameters.Set("custom_message", "test");
myElement->DispatchEvent("click", parameters);


ProcessEvent(& event)
Code: Select all
if(event.GetType() == "click"){
   std::string message = event.GetParameter<std::string>("custom_message",0);
        //not working...    we can't see to get the parameter's value
}
aquawicket
 
Posts: 8
Joined: Fri Jun 27, 2014 6:07 am

Return to Using libRocket


cron