FocusBrowser: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (added example)
mNo edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Client function}}
{{Needs Example}}
{{New feature/item|3.0150|1.5||
{{New feature/item|3.0150|1.5||
This function will attempt to focus the [[Element/Browser|browser]] or unfocus all browsers. The browser that is focused will retrieve keyboard input.
This function will attempt to focus the [[Element/Browser|browser]] or unfocus all browsers. The browser that is focused will retrieve keyboard input.

Revision as of 11:55, 29 July 2016

This function will attempt to focus the browser or unfocus all browsers. The browser that is focused will retrieve keyboard input.

Syntax

bool focusBrowser ( browser webBrowser )

OOP Syntax Help! I don't understand this!

Method: browser:focus(...)


Required Arguments

  • webBrowser: The web browser to be focused - if this is nil, it will unfocus all browsers.

Returns

Returns true if the browser was focused or if nil was passed, false if it failed to focus or the browser does not exist.

Example

Click to collapse [-]
Client

This example creates browser and focus it

local browser = guiCreateBrowser(0, 0, 800, 600, false, false, false)
addEventHandler("onClientBrowserCreated", browser,
   function ()
       focusBrowser(source)
   end
)

See Also