WebGadget()
Syntax
Result = WebGadget(#Gadget, x, y, Width, Height, URL$ [, Flags])Description
Creates a Web gadget in the current GadgetList. If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. #Gadget will be the number returned by EventGadget() command.
The following commands can be used to act on a WebGadget:
- SetGadgetText(): Change the current URL.
- GetGadgetText(): Get the current URL.
- SetGadgetState(): Perform an action on the gadget. The following constants are valid:#PB_Web_Back : One step back in the navigation history. #PB_Web_Forward: One step forward in the navigation history. #PB_Web_Stop : Stop loading the current page. #PB_Web_Refresh: Refresh the current page.'Flags' is an optional parameter and can be composed of one of the following constants:#PB_Web_Mozilla : Uses the Mozilla ActiveX instead of the IE one (Windows only).Note: on Microsoft Windows the WebGadget uses the Internet Explorer 4.0+ ActiveX object. This means that IE has to be installed (already present on Win98/Me and Win2000/XP). The ATL.dll, present in the PureBasic\Compilers\ directory is also needed, and must be in the same directory as the executable. As an alternative, the Mozilla ActiveX can be used instead (http://www.iol.ie/~locka/mozilla/mozilla.htm) if the #PB_Web_Mozilla flag is specified (the Mozilla ActiveX needs to be installed separately, it isn't bundled with FireFox or Mozilla).
Example:If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com") ; Note: if you want to use a local file, change last parameter to "file://" + path + filename Repeat Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf
Supported OS
Windows, Linux (GTK+2), MacOS X