Widget Candy. .Set()

Widget Candy
Send Snippet To: Save this snippet to Code Collector Pro -- view all roger's snippets
language: Other
license: Other

Code for Snippet:

                
 
 
Changes a widget's properties (either a single property or multiple properties at once). It's basically the same as using a widget's :set() method -whatever you prefer.
 
-- LOAD THE LIBRARY AND USE A GLOBAL VAR TO STORE A REFERENCE:
_G.GUI = require("widget_candy")
 
-- CREATE A BUTTON
_G.GUI.NewButton(
	{
	x       = 50,
	y       = 50,
	theme   = "MyTheme",
	name    = "Button1",
	caption = "HI!",
	} )
 
-- CHANGE THE BUTTON'S PROPERTIES:
_G.GUI.Set( "Button1", { x = 100, y = 100, caption = "HELLO!" } )
"caption", "HELLO!")
 
Set (widgetName, propertyTable)
 
widgetName	(String) The name of a widget.
 
propertyTable	(Table) A table with properties (name / value pairs) to be applied to the widget.
 
 
comments powered by Disqus

Info

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 25
Date Added: 2018-01-10 14:35:17
Last Modified: 2018-01-10 09:54:13

Web Analytics