We now have a youtube channel. Subscribe!

Python Tkinter Dimensions(Setting Width and Height)

Hello dear readers! welcome back to another section of our tutorial on Python. In this tutorial post, we are going to be discussing about Python Tkinter Dimensions.

Various lengths, widths and so many other dimensions of widgets can be described in many different units -

  • If you set a dimension to an integer, it is assumed to be in pixels.
  • You can specify the units by setting a dimension to a string containing a number followed by -

Sr.No.Character & Description
Printer's points (about 1/72")

Legnth Options

The Python Tkinter expresses legnth as an integer number of pixels. Here is the list of common legnth options -

  • borderwidth - Width of the border which gives a 3D look to the widget.
  • highlightthickness - Width of the highlight rectangle when the widget is focus.
  • padX padY - Extra space the widget requests from its layout manager beyond the minimum that the widget needs to display its contents in the x and y directions.
  • selectborderwidth - Width of the 3D border around the selected items of the widget.
  • wraplength - Maximum line length for the widgets that carry out word wrapping.
  • height - Desired height of the widget, must be greater than or equal to 1.
  • underline - Index of the character to underline in the widget's text.
  • width - Desired width of the widget.

Alright guys! This is where we are rounding up for this tutorial post. In our next tutorial, we are going to be discussing about the Python Tkinter Colors.

Feel free to ask your questions where necessary and i will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.

Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.

Thanks for reading and bye for now.

Post a Comment

Hello dear readers! Please kindly try your best to make sure your comments comply with our comment policy guidelines. You can visit our comment policy page to view these guidelines which are clearly stated. Thank you.
© 2023 ‧ WebDesignTutorialz. All rights reserved. Developed by Jago Desain