Module: WindowTerminal::Templates

Defined in:
lib/accu-window.rb

Overview

This module contains methods that generate simple window setups (perhaps for use with WindowManager.)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.generate(num) ⇒ Object

Returns an array containing the window objects generated by the template number passed.



546
547
548
549
550
551
# File 'lib/accu-window.rb', line 546

def self.generate(num)
	raise TypeError "Num must be an integer!" if (not num.is_a? Fixnum)
	if num == 1 then
		self.simple()
	end
end

.simpleObject

Creates a simple, one window setup.

Corresponds to generate(1)



557
558
559
560
561
562
# File 'lib/accu-window.rb', line 557

def self.simple()
	win = WindowTerminal::Window.new(WindowTerminal::Orientation.new,"Window")
	text = WindowTerminal::WrappedText.new(WindowTerminal::Orientation.new,"",8,:preserve)
	win.add_object text
	return [win]
end

Instance Method Details

#[](index) ⇒ Object

Calls generate() with (argument 1) + 1.



566
567
568
569
# File 'lib/accu-window.rb', line 566

def [](index)
	raise TypeError "Num must be an integer!" if (not num.is_a? Fixnum)
	generate(index+1)
end