class Canis::ListFooter

A vim-like application status bar that can display time and various other statuses

at the bottom, typically above the dock (3rd line from last).

Attributes

attrib[RW]
color_pair[RW]
config[RW]

Public Class Methods

new(config={}) click to toggle source
# File lib/canis/core/widgets/listfooter.rb, line 14
def initialize config={}, &block
  @config = config
  @color_pair = get_color($datacolor, config[:color], config[:bgcolor]) 
  @attrib = config[:attrib]
  instance_eval &block if block_given?
end

Public Instance Methods

command(*args, &blk) click to toggle source

command that returns a string that populates the status line (left aligned) @see :right e.g.

@l.command { "%-20s [DB: %-s | %-s ]" % [ Time.now, $current_db || "None", $current_table || "----"] }
# File lib/canis/core/widgets/listfooter.rb, line 26
def command *args, &blk
  @command_text = blk
  @command_args = args
end
Also aliased as: left
command_right(*args, &blk) click to toggle source

Procudure for text to be right aligned in statusline

# File lib/canis/core/widgets/listfooter.rb, line 34
def command_right *args, &blk
  @right_text = blk
  @right_args = args
end
left(*args, &blk)
Alias for: command
print(comp) click to toggle source

supply a default print function. The user program need not call this. It may be overridden The idea of passing a component at this stage is that one footer can be created for several tables or text components, each will pass self when calling print. @param comp : the calling textpad component (usually passed as self)

right_text(comp) click to toggle source
# File lib/canis/core/widgets/listfooter.rb, line 41
def right_text(comp)
  @right_text.call(comp, @right_args) 
end
text(comp) click to toggle source
# File lib/canis/core/widgets/listfooter.rb, line 38
def text(comp)
  @command_text.call(comp, @command_args) 
end