Thanks to all an merry happy days!

Hi,skinkairewalker wrote: Sat Dec 23, 2023 9:01 pmI just tested it on Windows 11 and Windows 10 ( It took a few seconds of a white screen due to junky hardware, but it worked fine) .User_Russian wrote: Sat Dec 23, 2023 8:44 pm I tested the code with WebViewGadget from the first post in Win 7, Win 8 and Win 10, and the window is always empty (gadget is not initialized).
Does anyone have this code working fine?
WebGadget when using a flag #PB_Web_Edge it is also not initialized.
Is this a bug?
both worked for me...
Code: Select all
#URL = "https://www.purebasic.fr"
; Tests on Windows 10 and Windows 11
; Bad usage, but works (I will not use this, just to test WebView2)
OpenWindow (0, 500, 0, 1000, 300, "WebViewGadget - Bad usage, but works! :o)", #PB_Window_SystemMenu)
WebViewGadget(0, 10, 10, 980, 280)
*Buf = ReceiveHTTPMemory(#URL)
SetGadgetText(0, PeekS(*Buf, MemorySize(*Buf), #PB_UTF8|#PB_ByteLength))
; Good, but does not work
OpenWindow(1, 500, 350, 1000, 300,"WebGadget with #PB_Web_Edge - Blank page even after minutes... :-(", #PB_Window_SystemMenu)
WebGadget(1, 10, 10, 980, 280, #URL, #PB_Web_Edge)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Code: Select all
WebGadget(1, 10, 10, 980, 280, "", #PB_Web_Edge)
SetGadgetText(1, #URL)
Thanks Useful! this Worksuseful wrote: Sun Dec 24, 2023 4:16 pmIt was experimentally obtained that it would work like this.Code: Select all
WebGadget(1, 10, 10, 980, 280, "", #PB_Web_Edge) SetGadgetText(1, #URL)
But it still needs clarification.
Code: Select all
#URL = "https://www.purebasic.fr"
; Tests on Windows 10 and Windows 11
; Bad usage, but works (I will not use this, just to test WebView2)
OpenWindow (0, 500, 0, 1000, 300, "WebViewGadget - Bad usage, but works! :o)", #PB_Window_SystemMenu)
WebViewGadget(0, 10, 10, 980, 280)
*Buf = ReceiveHTTPMemory(#URL)
SetGadgetText(0, PeekS(*Buf, MemorySize(*Buf), #PB_UTF8|#PB_ByteLength))
; Good, but does not work
OpenWindow(1, 500, 350, 1000, 300,"WebGadget without #PB_Web_Edge - OK ", #PB_Window_SystemMenu)
WebGadget(1, 10, 10, 980, 280, #URL)
; Good, but does not work
OpenWindow(2, 500, 700, 1000, 300,"WebGadget with #PB_Web_Edge - Blank page even after minutes... :-(", #PB_Window_SystemMenu)
WebGadget(2, 10, 10, 980, 280, #URL, #PB_Web_Edge)
; Good, but strange usage (thanks useful)
OpenWindow(3, 500, 1050, 1000, 300,"WebGadget with #PB_Web_Edge and then SetGadgetText - Works but is it the way ?", #PB_Window_SystemMenu)
WebGadget(3, 10, 10, 980, 280, "", #PB_Web_Edge)
SetGadgetText(3, #URL)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Code: Select all
SetGadgetText(4, ~"<script>window.location='" + #URL + "';</script>")
Available since version v6.0 for Arm32 and Arm64. But does not only run on Raspberry.skywalk wrote: Sun Dec 24, 2023 7:03 pm I just noticed support for RaspberryPi ARM32![]()
Was this just 6.10 or from an earlier version?
I also cannot get WebGadget with #PB_Web_Edge to work and create a Gadget (isgadget() returns correctly and ID but window does not exists)skinkairewalker wrote: Sat Dec 23, 2023 9:01 pmI just tested it on Windows 11 and Windows 10 ( It took a few seconds of a white screen due to junky hardware, but it worked fine) .User_Russian wrote: Sat Dec 23, 2023 8:44 pm I tested the code with WebViewGadget from the first post in Win 7, Win 8 and Win 10, and the window is always empty (gadget is not initialized).
Does anyone have this code working fine?
WebGadget when using a flag #PB_Web_Edge it is also not initialized.
Is this a bug?
both worked for me...
Code: Select all
OpenWindow(3, 100, 100, 1000, 500,"WebGadget with #PB_Web_Edge - works only in a simple case", #PB_Window_SystemMenu)
Panel_0 = PanelGadget(#PB_Any, 0, 0, 900, 450)
AddGadgetItem(Panel_0, -1, "HTML")
webview = WebGadget(#PB_Any, 10, 10, 980, 280, "", #PB_Web_Edge) ; only works in simple app with single file, in a project with 20 forms - not working
AddGadgetItem(Panel_0, -1, "Another")
webview2 = WebGadget(#PB_Any, 10, 10, 980, 280, "", #PB_Web_Edge)
fileurl.s = "file://e:\PureBasicProjects\happyHour.html"
fileurl = ReplaceString(fileurl, "\", "/") ; should not be necessary with IE or WebView!
fileurl = URLEncoder(fileurl, #PB_UTF8) ; should not be necessary on Windows, only some MacOS versions
CloseGadgetList()
SetGadgetText(webview, "https://purebasic.com") ; yeah, works, unless specified in gadget creation
SetGadgetText(webview2, fileurl) ; never works, works on Edge and other WebView2 based apps though fine
Quit= 0
Repeat
event = WaitWindowEvent()
If Event
If Event = #PB_Event_CloseWindow
Quit = 1
EndIf
Else
Delay(10)
EndIf
Until Quit