EthanB
26-01-2011 00:49:47
Is there a way to get events from the Berkelium Widget?
I need to get the current URL that the browser is at and display it in the url bar, but I see no way to do this because there is no BerkeliumWidget member in the MyGUI namespace.
EDIT: I've managed to do it by adding an eventChangeProperty to the onAddressBarChanged delgate.
If anyone else needed to do this, this is how:
Open BerkeliumWidget.h
Find the onAddressBarChanged delgate, it will look like this:
Change it to:
Compile it and now create an eventChangeProperty delgate for your berkelium widget, _key will be "URL" and _value will the the url.
I need to get the current URL that the browser is at and display it in the url bar, but I see no way to do this because there is no BerkeliumWidget member in the MyGUI namespace.
EDIT: I've managed to do it by adding an eventChangeProperty to the onAddressBarChanged delgate.
If anyone else needed to do this, this is how:
Open BerkeliumWidget.h
Find the onAddressBarChanged delgate, it will look like this:
virtual void onAddressBarChanged(Berkelium::Window *win, Berkelium::URLString newURL) {}
Change it to:
virtual void onAddressBarChanged(Berkelium::Window *win, Berkelium::URLString newURL)
{
eventChangeProperty( this, "URL", std::string( newURL.mData ) );
}
Compile it and now create an eventChangeProperty delgate for your berkelium widget, _key will be "URL" and _value will the the url.