Webgadget Callback

Mac OSX specific forum
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Webgadget Callback

Post by mk-soft »

Callback not work

Code: Select all

Procedure NavigationCallback(Gadget, Url$) 
  Debug Url$
  If Url$= "http://www.purebasic.com/news.php" 
    MessageRequester("", "No news today!") 
    ProcedureReturn #False 
  Else 
    ProcedureReturn #True 
  EndIf 
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
Last edited by mk-soft on Mon Aug 14, 2017 1:12 pm, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: (PB v5.44 / v5.45) Webgadget Callback

Post by Shardik »

As far as I know #PB_Web_NavigationCallback has never been implemented for Linux and MacOS. Take a look into the documentation:
PB documentation wrote:SetGadgetAttribute(): Set the following attributes (Windows only):

#PB_Web_ScrollX : Set the horizontal scrolling position.
#PB_Web_ScrollY : Set the vertical scrolling position.
#PB_Web_BlockPopups : Block popup windows. #PB_EventType_PopupWindow is fired if this setting is enabled.
#PB_Web_BlockPopupMenu: Block standard the popup menu. #PB_EventType_PopupMenu is fired if this setting is enabled.
#PB_Web_NavigationCallback: Set a callback for monitoring (and disabling) navigation.
In this feature request from 2013 for implementing a navigation callback for Linux and MacOS I also demonstrated workarounds.
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: (PB v5.44 / v5.45) Webgadget Callback

Post by mk-soft »

Ups, sorry :(

Sometimes I forget this.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply