diff options
Diffstat (limited to 'ClientHamr/GuiLua/test.lua')
-rw-r--r-- | ClientHamr/GuiLua/test.lua | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/ClientHamr/GuiLua/test.lua b/ClientHamr/GuiLua/test.lua index 4ddbc1d..f45aff9 100644 --- a/ClientHamr/GuiLua/test.lua +++ b/ClientHamr/GuiLua/test.lua | |||
@@ -4,26 +4,14 @@ do -- Only I'm not gonna indent this. | |||
4 | 4 | ||
5 | local skang = require 'skang' | 5 | local skang = require 'skang' |
6 | local _M = skang.moduleBegin('test', nil, 'Copyright 2014 David Seikel', '0.1', '2014-03-27 03:57:00', [[ | 6 | local _M = skang.moduleBegin('test', nil, 'Copyright 2014 David Seikel', '0.1', '2014-03-27 03:57:00', [[ |
7 | #!/usr/bin/env skang -- Lua allows this shell hack. | 7 | local widget = require 'widget' |
8 | 8 | ||
9 | -- There's an implied local this = require 'test' | 9 | skang.clear |
10 | -- There's an implied local skang = require 'skang' | 10 | skang.window(200, 200, "G'day planet.") |
11 | 11 | quitter = widget.button('Quit', 0.5, 0.5, 0.5, 0.5) | |
12 | local widget = require 'widget' | 12 | quitter:action('quit') |
13 | -- local other = require 'otherPackageName' | ||
14 | |||
15 | skang.clear | ||
16 | skang.window(200, 200, "G'day planet.") | ||
17 | |||
18 | quitter = widget.button('Quit', 0.5, 0.5, 0.5, 0.5) | ||
19 | quitter:action('quit') -- 'quit' is looked up in ThingSpace.commands, and translated into the Lua 'skang.quit()'. | ||
20 | |||
21 | --other.foo = 'stuff' | ||
22 | this.bar = 'things' | ||
23 | this.func(1, 'two') | ||
24 | ]]) | 13 | ]]) |
25 | 14 | ||
26 | |||
27 | print('code') | 15 | print('code') |
28 | 16 | ||
29 | -- A variable that is private to this module. | 17 | -- A variable that is private to this module. |
@@ -53,6 +41,10 @@ local test_c = require 'test_c' | |||
53 | local copy = skang.copy(test, 'copy') | 41 | local copy = skang.copy(test, 'copy') |
54 | 42 | ||
55 | print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.get(test, 'ffunc', 'help') .. ' ->> ' .. skang.get(test, 'f', 'action')) | 43 | print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.get(test, 'ffunc', 'help') .. ' ->> ' .. skang.get(test, 'f', 'action')) |
44 | |||
45 | print(test.DEFAULT_SKANG) | ||
46 | print('') | ||
47 | |||
56 | print('foo = ' .. test.foo .. ' ->> ' .. skang.get(test, 'foo', 'help')) | 48 | print('foo = ' .. test.foo .. ' ->> ' .. skang.get(test, 'foo', 'help')) |
57 | print('cfooble = ' .. test_c.cfooble .. ' ->> ' .. skang.get(test_c, 'cfooble', 'help') .. '[' .. skang.get(test_c, 'cfooble', 'widget') .. ']') | 49 | print('cfooble = ' .. test_c.cfooble .. ' ->> ' .. skang.get(test_c, 'cfooble', 'help') .. '[' .. skang.get(test_c, 'cfooble', 'widget') .. ']') |
58 | print('cfunc ->> ' .. skang.get(test_c, 'cfunc', 'help')) | 50 | print('cfunc ->> ' .. skang.get(test_c, 'cfunc', 'help')) |