[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[m8n] LuaPower

It take a breath to run m8n on top of LuaPower

Installation steps

Loading snapshot


A simple button in a window

Note that it is a test, we will implement S8 wrappers soon...
--Open a window with a button
local ui = require'ui'
local win = ui:window{
	cw = 500, ch = 300,
	title = 'UI Demo',
	autoquit = true,
}

btn1 = ui:button{
	parent = win,         --top-level widget
	x = 100, y = 100,     --manually positioned by default
	text = 'Close',       --sized to fit the text by default
	cancel = true,        --close the window on Esc
	tags = 'blue',        --add a tag for styling
}

--style blue buttons for when mouse is over and no buttons are pressed.
ui:style('button blue :hot !:active', {
	background_color = '#66f', --make the background blue
})

function btn1:pressed() --handle button presses
	print'Button pressed!'
end

win:on('closed', function(self) --another way to set up an event handler
	print'Bye!'
end)

ui:run()


Wrappers can be found in m8n platform folder

Uploaded Image: UnderConstructionLine.gif