Sorry for doubleposting.
But there must be a intelligent workaround for this issue
http://www.purebasic.fr/english/viewtop ... 24&t=52168
To just get the URL of a current webgadget? Maybe CocoaMessage?
What URL is in webgadget
-
jesperbrannmark
- Enthusiast

- Posts: 536
- Joined: Mon Feb 16, 2009 10:42 am
- Location: sweden
- Contact:
Re: What URL is in webgadget
with #PB_Web_NavigationCallback?
(don't know if it works under MacOS)
Greetings ... Kiffi
Code: Select all
Procedure NavigationCallback(Gadget, Url$)
Debug Url$
ProcedureReturn #True
EndProcedure
If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com")
SetGadgetAttribute(0, #PB_Web_NavigationCallback, @NavigationCallback())
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Greetings ... Kiffi
Hygge
-
jesperbrannmark
- Enthusiast

- Posts: 536
- Joined: Mon Feb 16, 2009 10:42 am
- Location: sweden
- Contact:
Re: What URL is in webgadget
Thanks. But no
The navigationcallback is windows only...
The navigationcallback is windows only...
Re: What URL is in webgadget
Code: Select all
URL.s = PeekS(CocoaMessage(0, CocoaMessage(0, GadgetID(0), "mainFrameURL"), "UTF8String"), -1, #PB_UTF8)Re: What URL is in webgadget
Since the navigation callback is only implemented in Windows, I have modified a nice code example from Wilbert to do the same as the example from PB help posted by Kiffi. It intercepts and denies a click onto the news hyperlink on the purebasic homepage:
http://www.purebasic.fr/english/viewtop ... 08&start=5
http://www.purebasic.fr/english/viewtop ... 08&start=5

