GuiGetBrowser: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client_function}} {{New feature/item|3.0150|1.5|| This function creates gets the browser element behind a gui-browser (a browser that has been created via guiCre...") |
m (Fixed a typo in the explanation section.) |
||
(9 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Client function}} | ||
{{New feature/item|3.0150|1.5|| | {{New feature/item|3.0150|1.5|| | ||
This function | This function gets the browser element behind a gui-browser (a browser that has been created via [[guiCreateBrowser]]). | ||
}} | }} | ||
Line 8: | Line 8: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
browser guiGetBrowser ( gui-browser theBrowser )</syntaxhighlight> | browser guiGetBrowser ( gui-browser theBrowser )</syntaxhighlight> | ||
{{OOP||[[Element/gui-browser| | {{OOP||[[Element/gui-browser|guiBrowser]]:getBrowser|browser|}} | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theBrowser''' The gui-browser | *'''theBrowser:''' The gui-browser | ||
===Returns=== | ===Returns=== | ||
Returns the [[Element/ | Returns the [[Element/Browser|Browser]] element if a correct [[Element/gui-browser|gui-browser]] has been passed, ''false'' otherwise. | ||
==Example== | ==Example== | ||
This examples get's browser element from gui-browser and attach a webbrowser to a CEGUI window. | |||
<syntaxhighlight lang="lua"> | |||
--In order to render the browser on the full screen, we need to know the dimensions. | |||
local screenWidth, screenHeight = guiGetScreenSize() | |||
--Let's create a new browser in remote mode. | |||
local window = guiCreateWindow(200, 200, 1024, 768, "Webbrowser", false) | |||
local browser = guiCreateBrowser(0, 0, 800, 600, false, false, window) | |||
-- The event onClientBrowserCreated will be triggered, after the browser has been initialized. | |||
-- After this event has been triggered, we will be able to load our URL | |||
local theBrowser = guiGetBrowser(browser) -- Get the browser element from gui-browser | |||
addEventHandler("onClientBrowserCreated", theBrowser, | |||
function() | |||
-- After the browser has been initialized, we can load www.youtube.com | |||
loadBrowserURL(source, "http://www.youtube.com") | |||
end | |||
) | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{ | {{CEF_functions}} | ||
[[hu:guiGetBrowser]] | |||
[[RO:guiGetBrowser]] |
Latest revision as of 15:48, 8 April 2020
This function gets the browser element behind a gui-browser (a browser that has been created via guiCreateBrowser).
Syntax
browser guiGetBrowser ( gui-browser theBrowser )
OOP Syntax Help! I don't understand this!
- Method: guiBrowser:getBrowser(...)
- Variable: .browser
Required Arguments
- theBrowser: The gui-browser
Returns
Returns the Browser element if a correct gui-browser has been passed, false otherwise.
Example
This examples get's browser element from gui-browser and attach a webbrowser to a CEGUI window.
--In order to render the browser on the full screen, we need to know the dimensions. local screenWidth, screenHeight = guiGetScreenSize() --Let's create a new browser in remote mode. local window = guiCreateWindow(200, 200, 1024, 768, "Webbrowser", false) local browser = guiCreateBrowser(0, 0, 800, 600, false, false, window) -- The event onClientBrowserCreated will be triggered, after the browser has been initialized. -- After this event has been triggered, we will be able to load our URL local theBrowser = guiGetBrowser(browser) -- Get the browser element from gui-browser addEventHandler("onClientBrowserCreated", theBrowser, function() -- After the browser has been initialized, we can load www.youtube.com loadBrowserURL(source, "http://www.youtube.com") end )
See Also
- canBrowserNavigateBack
- canBrowserNavigateForward
- createBrowser
- executeBrowserJavascript
- focusBrowser
- getBrowserProperty
- getBrowserSettings
- getBrowserSource
- getBrowserTitle
- getBrowserURL
- injectBrowserMouseDown
- injectBrowserMouseMove
- injectBrowserMouseUp
- injectBrowserMouseWheel
- isBrowserDomainBlocked
- isBrowserFocused
- isBrowserLoading
- isBrowserRenderingPaused
- loadBrowserURL
- navigateBrowserBack
- navigateBrowserForward
- reloadBrowserPage
- requestBrowserDomains
- resizeBrowser
- setBrowserAjaxHandler
- setBrowserProperty
- setBrowserRenderingPaused
- setBrowserVolume
- toggleBrowserDevTools