aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/GuiLua/test.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-03 07:34:06 +1000
committerDavid Walter Seikel2014-04-03 07:34:06 +1000
commited8925b28dbb66383a5931165b82f0eaa97385f9 (patch)
tree506bf02d77799cd8efabd27b9f46c3eb4c012224 /ClientHamr/GuiLua/test.lua
parentLoad any matching .properties files into a module. (diff)
downloadSledjHamr-ed8925b28dbb66383a5931165b82f0eaa97385f9.zip
SledjHamr-ed8925b28dbb66383a5931165b82f0eaa97385f9.tar.gz
SledjHamr-ed8925b28dbb66383a5931165b82f0eaa97385f9.tar.bz2
SledjHamr-ed8925b28dbb66383a5931165b82f0eaa97385f9.tar.xz
Read in any matching .skang files in moduleBegin().
Diffstat (limited to 'ClientHamr/GuiLua/test.lua')
-rw-r--r--ClientHamr/GuiLua/test.lua26
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
5local skang = require 'skang' 5local skang = require 'skang'
6local _M = skang.moduleBegin('test', nil, 'Copyright 2014 David Seikel', '0.1', '2014-03-27 03:57:00', [[ 6local _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)
12local widget = require 'widget' 12 quitter:action('quit')
13-- local other = require 'otherPackageName'
14
15skang.clear
16skang.window(200, 200, "G'day planet.")
17
18quitter = widget.button('Quit', 0.5, 0.5, 0.5, 0.5)
19quitter:action('quit') -- 'quit' is looked up in ThingSpace.commands, and translated into the Lua 'skang.quit()'.
20
21--other.foo = 'stuff'
22this.bar = 'things'
23this.func(1, 'two')
24]]) 13]])
25 14
26
27print('code') 15print('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'
53local copy = skang.copy(test, 'copy') 41local copy = skang.copy(test, 'copy')
54 42
55print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.get(test, 'ffunc', 'help') .. ' ->> ' .. skang.get(test, 'f', 'action')) 43print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.get(test, 'ffunc', 'help') .. ' ->> ' .. skang.get(test, 'f', 'action'))
44
45print(test.DEFAULT_SKANG)
46print('')
47
56print('foo = ' .. test.foo .. ' ->> ' .. skang.get(test, 'foo', 'help')) 48print('foo = ' .. test.foo .. ' ->> ' .. skang.get(test, 'foo', 'help'))
57print('cfooble = ' .. test_c.cfooble .. ' ->> ' .. skang.get(test_c, 'cfooble', 'help') .. '[' .. skang.get(test_c, 'cfooble', 'widget') .. ']') 49print('cfooble = ' .. test_c.cfooble .. ' ->> ' .. skang.get(test_c, 'cfooble', 'help') .. '[' .. skang.get(test_c, 'cfooble', 'widget') .. ']')
58print('cfunc ->> ' .. skang.get(test_c, 'cfunc', 'help')) 50print('cfunc ->> ' .. skang.get(test_c, 'cfunc', 'help'))