Page 1 of 1

How to use the webgadget callback code?

Posted: Fri Aug 08, 2014 6:40 am
by garretthylltun
I found the code to use the navigational callback(http://www.purebasic.fr/english/viewtop ... t=callback) for the webgadget, but I'm not very versed in PB and am not sure how I can use this. Is this what I can use to let me know when a link is clicked? Get any page info using this? When the page loading is complete? The code is working, but I have no clue how to use it to obtain the information that I would like.

Can anyone please give me some tips on what I can do with this code?

Thanks in advance,
~Garrett

Re: How to use the webgadget callback code?

Posted: Fri Aug 08, 2014 10:09 am
by Shardik
garretthylltun wrote:Is this what I can use to let me know when a link is clicked?
Exactly! If the user clicks onto a hyperlink on a website, the WebGadgetCallback() will be called and the parameter *NavigationAction will contain a pointer to the clicked link. In your callback you may then decide whether to allow or reject the navigation to this link. The Linux and MacOS examples do exactly the same as example 2 (which currently only works in Windows) in PB's help for the WebGadget.