Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package.path =
- "/sys/modules/?.lua;/sys/modules/?/init.lua;" .. package.path
- local UI = require('opus.ui')
- local page = UI.Page {
- button = UI.Button {
- text = 'quit',
- ex = -2, y = 2,
- width = 6,
- },
- grid = UI.Grid {
- y = 4,
- columns = {
- { heading = 'col1', key = 'k', width = 6, textColor = colors.cyan },
- { heading = 'col2', key = 'v' },
- },
- values = {
- { k = 'key1', v = 'value1' },
- { k = 'key2', v = 'value2' },
- { k = 'key3', v = 'value3' },
- { k = 'key5', v = 'value5' },
- { k = 'key4', v = 'value4' },
- },
- sortColumn = 'k',
- },
- textEntry = UI.TextEntry {
- x = 2, y = 2,
- limit = 16,
- width = 32,
- shadowText = 'example entry',
- }
- }
- function page:eventHandler(event)
- if event.type == 'button_press' then
- UI:exitPullEvents()
- end
- return UI.Page.eventHandler(self, event)
- end
- UI:setPage(page)
- UI:pullEvents()
Add Comment
Please, Sign In to add comment