home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / curses-bsd4.4 / PSD.doc / intro.4 < prev    next >
Encoding:
Text File  |  1994-06-01  |  2.6 KB  |  70 lines

  1. .\" Copyright (c) 1980, 1993
  2. .\"    The Regents of the University of California.  All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that the following conditions
  6. .\" are met:
  7. .\" 1. Redistributions of source code must retain the above copyright
  8. .\"    notice, this list of conditions and the following disclaimer.
  9. .\" 2. Redistributions in binary form must reproduce the above copyright
  10. .\"    notice, this list of conditions and the following disclaimer in the
  11. .\"    documentation and/or other materials provided with the distribution.
  12. .\" 3. All advertising materials mentioning features or use of this software
  13. .\"    must display the following acknowledgement:
  14. .\"    This product includes software developed by the University of
  15. .\"    California, Berkeley and its contributors.
  16. .\" 4. Neither the name of the University nor the names of its contributors
  17. .\"    may be used to endorse or promote products derived from this software
  18. .\"    without specific prior written permission.
  19. .\"
  20. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  21. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  24. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  26. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  29. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. .\" SUCH DAMAGE.
  31. .\"
  32. .\"    @(#)intro.4    8.1 (Berkeley) 6/4/93
  33. .\"
  34. .sh 1 "Cursor Movement Optimizations"
  35. .pp
  36. One of the most difficult things to do properly is motion optimization.
  37. After using
  38. .Fn gettmode
  39. and
  40. .Fn setterm
  41. to get the terminal descriptions,
  42. the function
  43. .Fn mvcur
  44. deals with this task.
  45. It usage is simple:
  46. simply tell it where you are now and where you want to go.
  47. For example
  48. .(l
  49. mvcur(0\*,0\*,LINES/2\*,COLS/2);
  50. .)l
  51. .lp
  52. would move the cursor from the home position (0\*,0)
  53. to the middle of the screen.
  54. If you wish to force absolute addressing,
  55. you can use the function
  56. .Fn tgoto
  57. from the
  58. .b termlib (7)
  59. routines,
  60. or you can tell
  61. .Fn mvcur
  62. that you are impossibly far away,
  63. For example,
  64. to absolutely address the lower left hand corner of the screen
  65. from anywhere
  66. just claim that you are in the upper right hand corner:
  67. .(l
  68. mvcur(0\*,COLS\-1\*,LINES\-1\*,0);
  69. .)l
  70.