Sha256: d5f07157ff0d8a5a5849b0a9c2fa77c0abce6cfbbfad1c2f9a44be518faf253e

Contents?: true

Size: 602 Bytes

Versions: 4

Compression:

Stored size: 602 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 xPadding()
      if @parent.nil?
        return self.winPadding()
      else
        return @parent.winPadding()
      end
    end

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

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

    def data
      @data
    end 

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ppcurses-0.0.15 lib/ppcurses/actions/PromptAction.rb
ppcurses-0.0.14 lib/ppcurses/actions/PromptAction.rb
ppcurses-0.0.13 lib/ppcurses/actions/PromptAction.rb
ppcurses-0.0.12 lib/ppcurses/actions/PromptAction.rb