class Ncurses::Panel

making minimal changes as per ffi-ncurses 0.4.0 which implements panels

module Canis # too many places call Ncurses::Panel

Public Class Methods

method_missing(name, *args) click to toggle source
# File lib/canis/core/system/panel.rb, line 121
def method_missing(name, *args)
  if (FFI::NCurses.respond_to?(name))
    return FFI::NCurses.send(name, *args)
  end
  raise "Panel did not respond_to #{name} "
end
new(window) click to toggle source
# File lib/canis/core/system/panel.rb, line 7
def initialize(window)
  if window.respond_to?(:pointer)
    @pointer = FFI::NCurses.new_panel(window.pointer)
  else
    @pointer = FFI::NCurses.new_panel(window)
  end
end
update_panels() click to toggle source

these will be used when you say Ncurses::Panel.del_panel(@panel.pointer) You could directly say FFI:NCurses or even @panel.del_panel.

# File lib/canis/core/system/panel.rb, line 118
def update_panels
  FFI::NCurses.update_panels
end

Public Instance Methods

above()
Alias for: panel_above
below()
Alias for: panel_below
bottom()
Alias for: bottom_panel
bottom_panel() click to toggle source

Puts panel below all other panels.

# File lib/canis/core/system/panel.rb, line 19
def bottom_panel
  FFI::NCurses.bottom_panel(@pointer)
end
Also aliased as: bottom
del()
Alias for: del_panel
del_panel() click to toggle source

Remove the panel from the stack and deallocate the PANEL structure. Doesn't remove the associated window.

# File lib/canis/core/system/panel.rb, line 109
def del_panel
  FFI::NCurses.del_panel(@pointer)
end
Also aliased as: del, delete
delete()
Alias for: del_panel
hidden?()
Alias for: panel_hidden
hide()
Alias for: hide_panel
hide_panel() click to toggle source

Removes the given panel from the panel stack and thus hides it from view. The PANEL structure is not lost, merely removed from the stack.

# File lib/canis/core/system/panel.rb, line 45
def hide_panel
  FFI::NCurses.hide_panel(@pointer)
end
Also aliased as: hide
move(starty = 0, startx = 0)
Alias for: move_panel
move_panel(starty = 0, startx = 0) click to toggle source

Move the panel window so that its upper-left corner is at (starty,startx). It does not change the position of the panel in the stack. Be sure to use this method instead of {mvwin}, to move a panel window.

# File lib/canis/core/system/panel.rb, line 69
def move_panel(starty = 0, startx = 0)
  FFI::NCurses.move_panel(@pointer, starty, startx)
end
Also aliased as: move
panel_above() click to toggle source

Returns pointer to the panel above.

# File lib/canis/core/system/panel.rb, line 82
def panel_above
  FFI::NCurses.panel_above(@pointer)
end
Also aliased as: above
panel_below() click to toggle source

Return a pointer to the panel just below panel. If the panel argument is a pointer to 0, it returns a pointer to the top panel in the stack.

# File lib/canis/core/system/panel.rb, line 90
def panel_below
  FFI::NCurses.panel_below(@pointer)
end
Also aliased as: below
panel_hidden() click to toggle source

Returns true if the panel is in the panel stack, false if not. Returns ERR if the panel pointer is a null pointer.

# File lib/canis/core/system/panel.rb, line 76
def panel_hidden
  FFI::NCurses.panel_hidden(@pointer) == 0
end
Also aliased as: hidden?
panel_userptr() click to toggle source

Returns the user pointer for a given panel.

# File lib/canis/core/system/panel.rb, line 96
def panel_userptr
  FFI::NCurses.panel_userptr(@pointer)
end
Also aliased as: userptr
panel_window() click to toggle source

Returns a pointer to the window of the given panel.

# File lib/canis/core/system/panel.rb, line 51
def panel_window
  FFI::NCurses.panel_window(@pointer)
end
Also aliased as: window
pointer() click to toggle source
# File lib/canis/core/system/panel.rb, line 14
def pointer
  @pointer
end
replace(window)
Alias for: replace_panel
replace_panel(window) click to toggle source

Replace the window of the panel with the given window. Useful, for example, if you want to resize a panel. You can call {replace_panel} on the output of {wresize}. It does not change the position of the panel in the stack.

# File lib/canis/core/system/panel.rb, line 60
def replace_panel(window)
  FFI::NCurses.replace_panel(@pointer, window)
end
Also aliased as: replace
set_panel_userptr(user_pointer) click to toggle source

sets the panel's user pointer.

# File lib/canis/core/system/panel.rb, line 102
def set_panel_userptr(user_pointer)
  FFI::NCurses.set_panel_userptr(@pointer, user_pointer)
end
Also aliased as: userptr=
show()
Alias for: show_panel
show_panel() click to toggle source

Makes hidden panel visible by placing it on the top of the stack.

To ensure compatibility across platforms, use this method instead of {top_panel} when the panel is hidden.

# File lib/canis/core/system/panel.rb, line 37
def show_panel
  FFI::NCurses.show_panel(@pointer)
end
Also aliased as: show
top()
Alias for: top_panel
top_panel() click to toggle source

Put the visible panel on top of all other panels in the stack.

To ensure compatibility across platforms, use this method instead of {show_panel} when the panel is shown.

# File lib/canis/core/system/panel.rb, line 28
def top_panel
  FFI::NCurses.top_panel(@pointer)
end
Also aliased as: top
userptr()
Alias for: panel_userptr
userptr=(user_pointer)
Alias for: set_panel_userptr
window()
Alias for: panel_window