DxAddClickFunction
Jump to navigation
Jump to search
This function allows you to bind a function to a DxElement's click handler.
Syntax
bool dxAddClickFunction ( DxElement dxElement, function handlerFunction )
OOP Syntax Help! I don't understand this!
- Method: DxElement:addClickFunction(...)
Required Arguments
- dxElement: element you wish to bind a click function to
- handlerFunction: the handler function you wish to bind
Returns
Returns true if the function was bound successfully, false otherwise.
Example
This example prints a message to the chatbox every time a DxButton is left clicked (down).
local button = DxButton:new(0, 0, 100, 35, "Button") function myButtonFunction(button, state) if(button == "left" and state == "down") then outputChatBox("hello") end end dxAddClickFunction(button, myButtonFunction)
See Also
- dxAddClickFunction
- dxAddRenderFunction
- dxApplyMask
- dxBringToFront
- dxDestroy
- dxGetAlpha
- dxGetBounds
- dxGetChildren
- dxGetChildrenByType
- dxGetColor
- dxGetGlobalProperty
- dxGetHoverColor
- dxGetIndex
- dxGetInheritedBounds
- dxGetInheritedChildren
- dxGetInheritedChildrenByType
- dxGetInheritedParents
- dxGetMaskTexture
- dxGetNonRootElements
- dxGetObstructingElement
- dxGetParent
- dxGetPosition
- dxGetProperty
- dxGetRootElement
- dxGetRootElements
- dxGetSize
- dxGetText
- dxGetTextColor
- dxGetTexture
- dxGetTopLevelChildren
- dxGetVisible
- dxIsChild
- dxIsFront
- dxIsInheritedChild
- dxIsObstructed
- dxIsObstructedByElement
- dxIsParent
- dxIsRootElement
- dxRemoveClickFunction
- dxRemoveRenderFunction
- dxSendToBack
- dxSetAlpha
- dxSetCentered
- dxSetColor
- dxSetDragArea
- dxSetGlobalProperty
- dxSetHoverColor
- dxSetIndex
- dxSetMaskEnabled
- dxSetParent
- dxSetPosition
- dxSetProperty
- dxSetSize
- dxSetText
- dxSetTextColor
- dxSetVisible
- isMouseOverDxElement