diff options
author | David Walter Seikel | 2014-03-20 16:54:04 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-03-20 16:54:04 +1000 |
commit | 282df2056083b28267f373b8a6f2a3cd063c2657 (patch) | |
tree | b6d1fadb4159d31e0635bfc4e735062201e8bdbb /ClientHamr | |
parent | TODO++ (diff) | |
download | SledjHamr-282df2056083b28267f373b8a6f2a3cd063c2657.zip SledjHamr-282df2056083b28267f373b8a6f2a3cd063c2657.tar.gz SledjHamr-282df2056083b28267f373b8a6f2a3cd063c2657.tar.bz2 SledjHamr-282df2056083b28267f373b8a6f2a3cd063c2657.tar.xz |
Fleshing out the merged Thing idea some more.
Diffstat (limited to 'ClientHamr')
-rw-r--r-- | ClientHamr/GuiLua/skang.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua index eccd9d8..ceb5e30 100644 --- a/ClientHamr/GuiLua/skang.lua +++ b/ClientHamr/GuiLua/skang.lua | |||
@@ -248,6 +248,17 @@ end | |||
248 | 248 | ||
249 | Or we could merge the other way - | 249 | Or we could merge the other way - |
250 | Each Thing has names (including shortcuts and aliases), type, required, widget default arguments, default value, function, help text. | 250 | Each Thing has names (including shortcuts and aliases), type, required, widget default arguments, default value, function, help text. |
251 | This does make the entire "Things with the same name link automatically" deal work easily, since they ARE the same Thing. | ||
252 | skang.newThing(_M, 'foo,s,fooAlias', 'string', 'Nope', '"button", "The foo :"' 1, 1, 10, 50', 'Default', function () print(_M.foo) end, 'Foo is a bar, not the drinking type.') | ||
253 | myButton = skang.widget('foo') -- Gets the default widget creation arguments. | ||
254 | myButton:colour(1, 2, 3, 4) | ||
255 | myEditor = skang.widget('foo', "edit", "Edit foo :", 5, 15, 10, 100) | ||
256 | myEditor:colour(1, 2, 3, 4, 5, 6, 7, 8) | ||
257 | myButton = 'Not default' -- myEditor and _M.foo change to. | ||
258 | -- Though the 'quit' Thing could have a function that does quitting, this is just an example of NOT linking to a Thing. | ||
259 | -- If we had linked to this theoretical 'quit' Thing, then pushing that Quit button would invoke it's Thing function. | ||
260 | quitter = skang.widget(nil, 'button', 'Quit', 0.5, 0.5, 0.5, 0.5) | ||
261 | quitter:action('quit') | ||
251 | ]] | 262 | ]] |
252 | 263 | ||
253 | -- skang.newCommand stashes the function into _M['func'], and stashes it all (including the function) into ThingSpace.commands['func']. | 264 | -- skang.newCommand stashes the function into _M['func'], and stashes it all (including the function) into ThingSpace.commands['func']. |