Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python - Tkinter Anchors


previous next AddThis Social Bookmark Button


Anchors are used to define where text is positioned relative to a reference point.

Here is list of possible constants which can be used for Anchor attribute.

  • NW

  • N

  • NE

  • W

  • CENTER

  • E

  • SW

  • S

  • SE

For example, if you use CENTER as a text anchor, the text will be centered horizontally and vertically around the reference point.

Anchor NW will position the text so that the reference point coincides with the northwest (top left) corner of the box containing the text.

Anchor W will center the text vertically around the reference point, with the left edge of the text box passing through that point, and so on.

If you create a small widget inside a large frame and use the anchor=SE option, the widget will be placed in the bottom right corner of the frame. If you used anchor=N instead, the widget would be centered along the top edge.

Example:

The anchor constants are shown in this diagram:

TK Anchor


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names