class TopinambourOverlay

This overlay contains the main terminal and allows another widgets to be displayed on top of it.

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/window.rb, line 88
def initialize
  super()
end

Public Instance Methods

add_main_widget(terminal) click to toggle source
# File lib/window.rb, line 92
def add_main_widget(terminal)
  @terminal = terminal
  add(@terminal)
end
add_secondary_widget(widget) click to toggle source

Add a widget over the main widget of the overlay.

# File lib/window.rb, line 98
def add_secondary_widget(widget)
  add_overlay(widget)
  set_overlay_pass_through(widget, false)
end
exit_overlay_mode() click to toggle source

Display only the main widget.

# File lib/window.rb, line 109
def exit_overlay_mode
  children[1].destroy if in_overlay_mode?
end
in_overlay_mode?() click to toggle source

Check if there is a widget displayed on top of the main widget.

# File lib/window.rb, line 104
def in_overlay_mode?
  children.size > 1
end
toggle_overlay(klass) click to toggle source
# File lib/window.rb, line 113
def toggle_overlay(klass)
  exit_overlay_mode
  if in_overlay_mode? && @overlay.children[1].class == klass
    @terminal.term.grab_focus
  else
    add_secondary_widget(klass.new(@terminal.toplevel))
    children[1].show_all
  end
end