DMultiChoice.OnSelect

From GMod Wiki

Jump to: navigation, search
Function
Syntax DMultiChoice:OnSelect( number index, String value, var Data )
Description:
You can over ride this function, it will be called when the user selects an option.
Returns: nil
In Object: DMultiChoice
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DMultiChoice.OnSelect]DMultiChoice.OnSelect [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSends a message to the client when selects an option
Used onNewerClient.png
Code
function myPanel:OnSelect(index,value,data)
	print("Option " .. value .. " has been picked at the index " .. index )
end
OutputWhen an option is selected, prints its value and index number


DescriptionCan also be seen like this.
Used onNewerClient.png
Code
myPanel.OnSelect = function(panel,index,value,data)
	print("Option " .. value .. " has been picked at the index " .. index )
end
OutputSame as above example


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox