moar ui examples

This commit is contained in:
kepler155c@gmail.com
2019-11-14 15:43:20 -07:00
parent 3241326a2f
commit 14057c2bf9
7 changed files with 105 additions and 4 deletions

View File

@@ -50,3 +50,29 @@ function UI.SlideOut:eventHandler(event)
return true
end
end
function UI.SlideOut.example()
return UI.Window {
button = UI.Button {
x = 2, y = 2,
text = 'show',
},
slideOut = UI.SlideOut {
backgroundColor = colors.yellow,
y = -4, height = 4,
button = UI.Button {
x = 2, y = 2,
text = 'hide',
},
},
eventHandler = function (self, event)
if event.type == 'button_press' then
if self.slideOut.enabled then
self.slideOut:hide()
else
self.slideOut:show()
end
end
end,
}
end