Sha256: 5734fd5a5518d5c56fc4eba6442b2d9dce3b1b2a333b2b51f8c6c8d058f369bc

Contents?: true

Size: 409 Bytes

Versions: 2

Compression:

Stored size: 409 Bytes

Contents

require "curses"


class PromptAction < BaseAction

  def initialize(prompt)
    @prompt = prompt
  end

  def setWindow(win)
    @win = win
  end

  def setParentAction(action)
    @parent = action
  end

  def printPrompt()
    @win.setpos(@win.cury(), @parent.winPadding())
    @win.addstr(@prompt)
  end

  def execute()
    printPrompt()
    @data = @win.getstr()
  end

  def data
    @data
  end 
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ppcurses-0.0.9 lib/ppcurses/actions/PromptAction.rb
ppcurses-0.0.8 lib/ppcurses/actions/PromptAction.rb