WebGadget-Invalid Memory Access
Posted: Fri Jun 14, 2024 5:41 pm
I've just discovered the webgadget and have a problem. I have a window based on the example 'The Worlds Smallest Browser' (can't find the link right now), in my large program, and it works fine if I resize or close the window but if I click anywhere in the web window then hit the close button (red dot) I get a Invalid Memory Access in the main event loop. If the program is compiled it just crashes.
I've re-created the error but maybe only on this link?
Worlds Smallest Web Browser (Mini Browser)
https://www.purebasic.com/documentation ... er.pb.html
I've re-created the error but maybe only on this link?
Code: Select all
EnableExplicit
Define event
#window1=1
#window2=2
#webgadget1=1
If OpenWindow(#window1, 0, 0,865,535, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
;WebGadget(#webgadget1, 0, 0,WindowWidth(#window1),WindowHeight(#window1), "file://MacBkPro_SSD/Users/vering2/Apps_stuff/PB_examples/WebCamAddict.jpg")
WebGadget(#webgadget1, 0, 0,WindowWidth(#window1),WindowHeight(#window1), "https://finance.yahoo.com/quote/%5EIXIC/")
; Note: if you want to use a local file, change last parameter to "file://" + path + filename
EndIf
If OpenWindow(#window2, 10, 10,20,20, "blank window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
EndIf
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
CloseWindow(#window1) : Debug"Close window"
Case #PB_Event_SizeWindow
If EventGadget()=#webgadget1
ResizeGadget(#webgadget1,#PB_Ignore,#PB_Ignore,WindowWidth(#window1),WindowHeight(#window1))
EndIf
EndSelect
ForEver
https://www.purebasic.com/documentation ... er.pb.html