ComputerCraft Archive

Tab

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/Tab.lua tab
Archive:wget https://cc.shobie.xyz/cc/get/gh-kepler155c-opus-sys-modules-opus-ui-components-tab tab
Quick Install: wget https://cc.shobie.xyz/cc/get/gh-kepler155c-opus-sys-modules-opus-ui-components-tab Tab

Usage

Run: Tab

Tags

none

Source

View Original Source

Code Preview

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

UI.Tab = class(UI.Window)
UI.Tab.defaults = {
	UIElement = 'Tab',
	title = 'tab',
	y = 2,
}

function UI.Tab:draw()
	if not self.noFill then
		self:fillArea(1, 1, self.width, self.height, string.rep('\127', self.width), colors.black, colors.gray)
	end
	self:drawChildren()
end

function UI.Tab:enable()
	UI.Window.enable(self)
	self:emit({ type = 'tab_activate', activated = self })
end