GuiMemoIsReadOnly

From Multi Theft Auto: Wiki
Revision as of 13:56, 10 August 2021 by Pawelo (talk | contribs) (Add missing OOP info)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function checking if memo is read only or no.

Syntax

bool guiMemoIsReadOnly ( gui-memo theMemo )

OOP Syntax Help! I don't understand this!

Method: GuiMemo:isReadOnly(...)
Variable: .readOnly
Counterpart: guiMemoSetReadOnly


Required Arguments

  • theMemo: The memo to check read-only status of.

Returns

Returns true if the memo is read only, false if the memo isn't read only, nil otherwise.

Example

addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), -- only execute the code when this resource restarts
	function( )
		memo = guiCreateMemo( 0.4, 0.4, 0.2, 0.2, "This is a memo.", true ) -- create a relative memo GUI element
		guiMemoSetReadOnly( memo, true ) -- make it read only, so players won't be able to edit it in-game
                addCommandHandler("isReadOnly",function() -- add a command 'isReadOnly'
                     local isReadOnly = guiMemoIsReadOnly(memo)
                     outputChatBox("Memo read only: "..isReadOnly) -- show info about memo
                end)
	end
)

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI