lib/ppcurses/actions/PromptAction.rb in ppcurses-0.0.11 vs lib/ppcurses/actions/PromptAction.rb in ppcurses-0.0.12

- old
+ new

@@ -9,15 +9,19 @@ def setParentAction(action) @parent = action end - def printPrompt() + def xPadding() if @parent.nil? - @win.setpos(@win.cury(), self.winPadding()) + return self.winPadding() else - @win.setpos(@win.cury(), @parent.winPadding()) + return @parent.winPadding() end + end + + def printPrompt() + @win.setpos(@win.cury(), xPadding()) @win.addstr(@prompt) end def execute() printPrompt()