WebGadget()

Syntax

Result = WebGadget(#Gadget, x, y, Width, Height, URL$)
Description
Creates a Web gadget in the current GadgetList. It can display html pages.

Parameters

#Gadget A number to identify the new gadget. #PB_Any can be used to auto-generate this number.
x, y, Width, Height The position and dimensions of the new gadget.
URL$ The url to load after the gadget is created.

Return value

Returns nonzero on success and zero on failure. If #PB_Any was used as the #Gadget parameter then the return-value is the auto-generated gadget number on success.

The following functions 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.

- GetGadgetItemText(): The following constants can be used to get information (only works on the same page domain):
  #PB_Web_HtmlCode     : Get the html code from the gadget.
  #PB_Web_PageTitle    : Get the current title for the displayed page.
  #PB_Web_StatusMessage: Get the current statusbar message.
  #PB_Web_SelectedText : Get the currently selected text inside the gadget.

Example

  If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    WebGadget(0, 10, 10, 580, 280, "http://www.spiderbasic.com")
  EndIf

See Also

GetGadgetText(), SetGadgetText(), GetGadgetItemText(), SetGadgetState()

Supported OS

All

<- UseGadgetList() - Gadget Index