WebViewGAdget and 'core\add_NavigationCompleted' interface option

Just starting out? Need help? Post your questions and find answers here.
zikitrake
Addict
Addict
Posts: 878
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

WebViewGAdget and 'core\add_NavigationCompleted' interface option

Post by zikitrake »

Following the example given by Fred in this post (https://www.purebasic.fr/english/viewto ... 16#p615816), has anyone used (or knows how to use) the following option?

core\add_NavigationCompleted (to detect when a page has been fully loaded)


Fred sample code:

Code: Select all

OpenWindow(0, 100, 100, 400, 400, "Hello", #PB_Window_SystemMenu)

WebViewGadget(0, 0, 0, 400, 400, #PB_WebView_Debug)

; Get the ICoreController interface 
;
Controller.ICoreWebView2Controller = GetGadgetAttribute(0, #PB_WebView_ICoreController)

; Get the ICoreWebView2 interface 
;
Controller\get_CoreWebView2(@Core.ICoreWebView2)
Core\Navigate("https://www.purebasic.com")

;!!!!!!!!!!! I Don't know how to implement this  :D 
Repeat
Until ¿¿¿¿¿core\add_NavigationCompleted()????
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

DataSection
	IID_ICoreWebView2Controller2:
	Data.l $C979903E
	Data.w $D4CA, $4228
	Data.b $92, $EB, $47, $EE, $3F, $A9, $6E, $AB
EndDataSection

If Controller\QueryInterface(?IID_ICoreWebView2Controller2, @Controller2.ICoreWebView2Controller2) = #S_OK
  Debug "ICoreWebView2Controller2 found: " + Controller2
Else
  Debug "Can't query ICoreWebView2Controller2"
EndIf

Repeat 
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow

Thank you in advance :)
PB 6.21 beta, PureVision User
User avatar
Kiffi
Addict
Addict
Posts: 1509
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: WebViewGAdget and 'core\add_NavigationCompleted' interface option

Post by Kiffi »

AFAIK core\add_NavigationCompleted() needs an EventHandler. Unfortunately, I don't know how to pass the parameters correctly.

(See also: https://www.purebasic.fr/english/viewto ... 86#p620686)
Hygge
zikitrake
Addict
Addict
Posts: 878
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Re: WebViewGAdget and 'core\add_NavigationCompleted' interface option

Post by zikitrake »

Thanks, I didn't see it!
Let's see if someone can enlighten us :D
PB 6.21 beta, PureVision User
Post Reply