Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
Procedure OnTimer()
DisableGadget(1, CocoaMessage(0,GadgetID(0),"canGoBack") ! 1) ; in Class 'WebView'
DisableGadget(2, CocoaMessage(0,GadgetID(0),"canGoForward") ! 1)
EndProcedure
CompilerEndIf
Procedure OnBack()
SetGadgetState(0, #PB_Web_Back)
EndProcedure
Procedure OnForward()
SetGadgetState(0, #PB_Web_Forward)
EndProcedure
If OpenWindow(0, 0, 0, 800, 600, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadget(0, 0, 25, 800, 575, "http://www.purebasic.com")
ButtonGadget(1, 0, 0, 100, 25, "Back")
BindGadgetEvent(1, @OnBack())
ButtonGadget(2, 100, 0, 100, 25, "Forward")
BindGadgetEvent(2, @OnForward())
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
; On Mac OS X we use a timer to check for 'canGoBack' and 'canGoForward'
AddWindowTimer(0, 0, 100)
BindEvent(#PB_Event_Timer, @OnTimer(), 0)
CompilerEndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf- "Support > PureBasic Forums"
- "Support > PureBasic online documentation"
- "Screenshots" -> pictures are displayed, and all links don't work
EDIT: I just realized that this links all open in a new Tab when using Chrome.
Almost everything in WebGadget is Windows-only (Navigation Callback,
SetGadgetAttribute() & GetGadgetAttribute(), #PB_EventType_PopupWindow event),
so it looks quite useless to me, without doing everything with WebKit API directly.
Another issue:
With enabled Debugger, I get the following message most of the time:
I get the message immediately after hitting F5 key. It is not waiting 10 seconds.PureBasic Debugger
The debugged executable did not respond to communication for 10 seconds. Disconnecting.
Anyone able to confirm this?
EDIT: After restarting the IDE, the debugger issue is gone. Works with debugger now.

