ComputerCraft Archive

FlatButton

computer utility kepler155c github

Description

ComputerCraft OS

Installation

Copy one of these commands into your ComputerCraft terminal:

wget:wget https://raw.githubusercontent.com/kepler155c/opus/develop-1.8/sys/modules/opus/ui/components/FlatButton.lua flatbutton
Archive:wget https://cc.shobie.xyz/cc/get/gh-kepler155c-opus-sys-modules-opus-ui-components-flatbutton flatbutton
Quick Install: wget https://cc.shobie.xyz/cc/get/gh-kepler155c-opus-sys-modules-opus-ui-components-flatbutton FlatButton

Usage

Run: FlatButton

Tags

none

Source

View Original Source

Code Preview

local class = require('opus.class')
local UI    = require('opus.ui')

UI.FlatButton = class(UI.Button)
UI.FlatButton.defaults = {
	UIElement = 'FlatButton',
	textColor = 'black',
	textFocusColor = 'white',
	noPadding = true,
}
function UI.FlatButton:setParent()
	self.backgroundColor = self.parent:getProperty('backgroundColor')
	self.backgroundFocusColor = self.backgroundColor

	UI.Button.setParent(self)
end