Method: CDK.moveCursesWindow

Defined in:
lib/cdk.rb

.moveCursesWindow(window, xdiff, ydiff) ⇒ Object

This moves a given window (if we’re able to set the window’s beginning). We do not use mvwin(), because it does not (usually) move subwindows.



745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/cdk.rb', line 745

def CDK.moveCursesWindow (window, xdiff, ydiff)
  return if window.nil?

  xpos = []
  ypos = []
  window.getbegyx(ypos, xpos)
  if window.mvwin(ypos[0], xpos[0]) != Ncurses::ERR
    xpos[0] += xdiff
    ypos[0] += ydiff
    window.werase
    window.mvwin(ypos[0], xpos[0])
  else
    CDK.Beep
  end
end