Skip to content

Instantly share code, notes, and snippets.

@rbistolfi
Created August 27, 2013 14:11
Show Gist options
  • Select an option

  • Save rbistolfi/6354042 to your computer and use it in GitHub Desktop.

Select an option

Save rbistolfi/6354042 to your computer and use it in GitHub Desktop.
-- example.lua
-- example of VASM framework
-- rbistolfi
vasm = require("vasm")
model = vasm.model
-- Create controller object
Example = vasm.Controller:new()
function Example:render()
self.count = 0
self.text = model.SimpleText:new {text = "Hello World!"}
return {
model.SimpleText:new {text= "This is an example"},
self.text
}
end
function Example:command()
self.count = self.count + 1
self.text:set_text("Hey! You clicked " .. self.count .. " times")
end
app = vasm.Application:new()
app:set_view("gtk")
app:run(Example)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment