home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / GetAnchor.3 < prev    next >
Encoding:
Text File  |  1993-04-01  |  3.0 KB  |  78 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/GetAnchor.3,v 1.4 93/04/01 09:41:23 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS Tk_GetAnchor tkc
  25. .BS
  26. .SH NAME
  27. Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings and anchor positions
  28. .SH SYNOPSIS
  29. .nf
  30. \fB#include <tk.h>\fR
  31. .sp
  32. Tk_Anchor
  33. \fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR
  34. .sp
  35. char *
  36. \fBTk_NameOfAnchor(\fIanchor\fB)\fR
  37. .SH ARGUMENTS
  38. .AS "Tk_Anchor" *anchorPtr
  39. .AP Tcl_Interp *interp in
  40. Interpreter to use for error reporting.
  41. .AP char *string in
  42. String containing name of anchor point: one of ``n'', ``ne'', ``e'', ``se'',
  43. ``s'', ``sw'', ``w'', ``nw'', or ``center''.
  44. .AP int *anchorPtr out
  45. Pointer to location in which to store anchor position corresponding to
  46. \fIstring\fR.
  47. .AP Tk_Anchor anchor in
  48. Anchor position, e.g. \fBTCL_ANCHOR_CENTER\fR.
  49. .BE
  50.  
  51. .SH DESCRIPTION
  52. .PP
  53. \fBTk_GetAnchor\fR places in \fI*anchorPtr\fR an anchor position
  54. (enumerated type \fBTk_Anchor\fR)
  55. corresponding to \fIstring\fR,  which will be one of
  56. \fBTK_ANCHOR_N\fR, \fBTK_ANCHOR_NE\fR, \fBTK_ANCHOR_E\fR, \fBTK_ANCHOR_SE\fR,
  57. \fBTK_ANCHOR_S\fR, \fBTK_ANCHOR_SW\fR, \fBTK_ANCHOR_W\fR, \fBTK_ANCHOR_NW\fR,
  58. or \fBTK_ANCHOR_CENTER\fR.
  59. Anchor positions are typically used for indicating a point on an object
  60. that will be used to position that object, e.g. \fBTK_ANCHOR_N\fR means
  61. position the top center point of the object at a particular place.
  62. .PP
  63. Under normal circumstances the return value is \fBTCL_OK\fR and
  64. \fIinterp\fR is unused.
  65. If \fIstring\fR doesn't contain a valid anchor position
  66. or an abbreviation of one of these names, then an error message is
  67. stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
  68. \fI*anchorPtr\fR is unmodified.
  69. .PP
  70. \fBTk_NameOfAnchor\fR is the logical inverse of \fBTk_GetAnchor\fR.
  71. Given an anchor position such as \fBTK_ANCHOR_N\fR it returns a
  72. statically-allocated string corresponding to \fIanchor\fR.
  73. If \fIanchor\fR isn't a legal anchor value, then
  74. ``unknown anchor position'' is returned.
  75.  
  76. .SH KEYWORDS
  77. anchor position
  78.