Sha256: 46cab2d3b62f44f566e94b658ec58027c76408a62efb9f68a9e2620ba7a1ecd7

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

require 'ppcurses/actions/BaseAction.rb'

module PPCurses
  class PromptAction < BaseAction

    def initialize(prompt)
      @prompt = prompt
    end

    def setParentAction(action)
      @parent = action
    end

    def printPrompt()
      if @parent.nil?
        @win.setpos(@win.cury(), self.winPadding())
      else
        @win.setpos(@win.cury(), @parent.winPadding())
      end
      @win.addstr(@prompt)
    end

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

    def data
      @data
    end 

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ppcurses-0.0.11 lib/ppcurses/actions/PromptAction.rb