OnDgsTextChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
Line 16: Line 16:
DGS = exports.dgs
DGS = exports.dgs
editBox = DGS:dgsCreateEdit(0.3,0.1,0.4,0.1,"",true)
editBox = DGS:dgsCreateEdit(0.3,0.1,0.4,0.1,"",true)
addEventHandler("onDgsTextChanged", editBox, function()  
addEventHandler("onDgsTextChange", editBox, function()  
   outputChatBox("The box now reads: " .. DGS:dgsGetText(source))
   outputChatBox("The box now reads: " .. DGS:dgsGetText(source))
end)
end)

Latest revision as of 13:51, 20 April 2018

This event is triggered when a dgs element text has changed (either by the user or by dgsSetText).

Parameters

element theElement

Source

The source of this event is the element which was changed.

Example

This example creates a dgs editbox and prints a message when it has changed

DGS = exports.dgs
editBox = DGS:dgsCreateEdit(0.3,0.1,0.4,0.1,"",true)
addEventHandler("onDgsTextChange", editBox, function() 
   outputChatBox("The box now reads: " .. DGS:dgsGetText(source))
end)

See Also

DGS events

General

Check Box

Combo Box

Drag'N Drop

Edit

Grid List

Menu

Selector

Mouse

Radio Button

Switch Button

Tab

Animation

Plugin

Media

Color Picker

QRCode

Remote Image

Client event functions