Navigation Callback not working - Default Browser

Just starting out? Need help? Post your questions and find answers here.
User avatar
JackWebb
Enthusiast
Enthusiast
Posts: 109
Joined: Wed Dec 16, 2009 1:42 pm
Location: Tampa Florida

Navigation Callback not working - Default Browser

Post by JackWebb »

Okay so..

I want to suppress navigation using IE from within a WebGadget, and use the default browser in it's place (the way it should be). The sample code below works fine and demonstrates what I am trying to accomplish. The problem is, it doesn't work in my working program. I suspect this may have something to do with the GadgetList but I've tried everything. Does anyone have an idea what may be going on?

I'm open to different method(s) of opening the default browser from within a WebGadget

Thank you in advance,
Jack

Code: Select all

;- Click on the news or download link
EnableExplicit

Declare NavigationCallback(Gadget, Url$)

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

Procedure NavigationCallback(Gadget, Url$)
  If Url$ = "http://www.purebasic.com/"
    Debug Url$
    ProcedureReturn #True
  Else
    Debug Url$
    RunProgram(Url$)
    ProcedureReturn #False
  EndIf
EndProcedure
Make everything as simple as possible, but not simpler. ~Albert Einstein