Definition: |
include pGUI.e
Ihandle ih = IupWebBrowser() |
Description: |
Creates a web browser control. It is responsible for managing the drawing of the web browser content and forwarding of its events.
In Linux, the implementation uses the WebKit/GTK+ , the new GTK+ port of the WebKit , an open-source web content engine. More information about WebKit/GTK+ (building, dependencies, releases, etc) can be seen in Notes section. It is only available for Linux26g4 and Linux26g4_64 systems. In Windows, the implementation uses the IupOleControl to embed an instance of the Internet Explorer WebBrowser control. A listener interface is used to capture and handle events using the Active Template Library ( (ATL) classes. More information about ATL can be seen in Notes section. So it is only available for Visual C++ compilers. The C IupWebBrowserOpen function must be called after IupOpen, however in Phix this is done automatically internally and hence there is no externally visible wrapper to that routine. Returns: the identifier of the created element. |
Notes: |
To learn more about WebKit and WebKitGTK+: The WebKit Open Source Project The WebKitGTK+ web page WebKitGTK+ wiki WebKitGTK+ tracker To learn more about Internet Explorer WebBrowser control and ATL: WebBrowser Control from C/C++ Creating ATL sinks Examples of sinking COM events |
Attributes: | |
BACKCOUNT | [GTK Only] (read only) gets the number of items that precede the current page. |
BACKFORWARD |
(write only) sets the number of steps away from the current page and loads the history item. Negative values represent steps backward while positive values represent steps forward. |
COPY | (write only) copy the selection to the clipboard. (since 3.10) |
FORWARDCOUNT | [GTK Only] (read only) gets the number of items that succeed the current page. |
HTML | (write only) loads a given HTML content. |
ITEMHISTORYid |
[GTK Only] (read only) Returns the URL associated with a specific history item. Negative "id" value represents a backward item while positive "id" value represents a forward item ("0" represents the current item). |
(write only) shows the print dialog. (since 3.10) | |
RELOAD | (write only) reloads the page in the webbrowser. |
SELECTALL | (write only) selects all contents. (since 3.10) |
STATUS | (read only) returns the load status. Can be "LOADING", "COMPLETED" or "FAILED". |
STOP | (write only) stops any ongoing load in the webbrowser. |
VALUE | sets a specified URL to load into the webbrowser, or retrieve the current URL. |
ZOOM | the zoom factor of the browser in percent. No zoom is 100%. (since 3.10) |
also | ACTIVE, FONT, EXPAND, SCREENPOSITION, POSITION, MINSIZE, MAXSIZE, WID, TIP, RASTERSIZE, ZORDER, VISIBLE: also accepted. |
Callbacks: | |
COMPLETED_CB |
action generated when a page successfully completed. Can be called multiple times when a frame set loads its frames, or when a page loads also other pages. function completed_cb(Ihandle ih, atom pUrl) ih: identifier of the element that activated the event. pUrl: (char*) the URL address that completed. |
ERROR_CB |
action generated when page load fail.
function error_cb(Ihandle ih, atom pUrl) ih: identifier of the element that activated the event. pUrl: (char*) the URL address that caused the error. |
NAVIGATE_CB |
action generated when the browser requests a navigation to another page. It is called before navigation occurs. Can be called multiple times when a frame set loads its frames, or when a page loads also other pages. function navigate_cb(Ihandle ih, atom pUrl) ih: identifier of the element that activated the event. pUrl: (char*) the URL address to navigate to. Returns: IUP_IGNORE will abort navigation (since 3.4). |
NEWWINDOW_CB |
action generated when the browser requests a new window.
function newwindow_cb(Ihandle ih, atom pUrl) ih: identifier of the element that activated the event. pUrl: (char*) the URL address that is opened in the new window. |
also | MAP_CB, UNMAP_CB, DESTROY_CB, GETFOCUS_CB, KILLFOCUS_CB, ENTERWINDOW_CB, LEAVEWINDOW_CB, K_ANY, HELP_CB: All common callbacks are supported. |
Examples |
![]() |