Sha256: c13e4cd0f7951217198f2fe8ca3ae355233870153f9b8684940c6ac57382a99b

Contents?: true

Size: 711 Bytes

Versions: 3

Compression:

Stored size: 711 Bytes

Contents

#noinspection RubyResolve
module PPCurses
  class BaseAction

    def set_window(win)
      @win = win
    end

    def x_padding
      self.win_padding
    end

    def win_padding
       2
    end

    # TODO -- need abstraction layer.
    def win_width
      Curses.cols - win_padding
    end

    def win_height
      Curses.lines - win_padding
    end

    def create_window
      @win = Window.new( self.win_height, self.win_width,
                         self.win_padding/2, self.win_padding/2)
      @win.clear
      @win.box('|', '-')
      @win.setpos(@win.cury+1, self.x_padding )
    end

    def show
      if @win.nil?
        self.create_window
      end

      @win.refresh
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ppcurses-0.1.2 lib/ppcurses/actions/BaseAction.rb
ppcurses-0.1.1 lib/ppcurses/actions/BaseAction.rb
ppcurses-0.1.0 lib/ppcurses/actions/BaseAction.rb