Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local scheme = {
- ack = {
- bg = colours.green,
- fg = colours.white,
- bgp = colours.blue,
- fgp = colours.white
- },
- stop = {
- bg = colours.red,
- fg = colours.black,
- bgp = colours.orange,
- fgp = colours.black
- },
- act = {
- bg = colours.grey,
- fg = colours.white,
- bgp = colours.lightGrey,
- fgp = colours.black
- }
- }
- local Button = {width = 1, height = 1, label = ""}
- function Button:new(o)
- local o = o or {}
- setmetatable(o, self)
- self.__index = self
- return o
- --[[
- if height < 0 then
- button["height"] = 1
- else
- button["height"] = height
- end
- if width < label:len() then
- button["width"] = label:len()
- else
- button["width"] = width
- end
- button["label"] = label
- button["colours"] = scheme[colours]
- button["parent"] = nil
- return button
- --]]
- end
- function Button:dump()
- print("-={ A button }=-")
- print("Width: "..self.width)
- print("Height: "..self.height)
- print("Label: "..self.label)
- print("Colours: "..tostring(self.colours))
- print("Parent: "..tostring(self.parent))
- print()
- end
- local Layout = {screen = nil}
- local b = Button:new{width=12, height=1, label="OK", colours=scheme.ack}
- b:dump()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement