Tkinter #3 : Pack and Attributes of Pack

 Pack and Attributes of Pack

We can add widget to the window by using three different classes as shown below. Pack is one of them
  1. pack() method:It organizes the widgets in blocks before placing in the parent widget.
  2. grid() method:It organizes the widgets in grid (table-like structure) before placing in the parent widget.
  3. place() method:It organizes the widgets by placing them on specific positions directed by the programmer.

Attributes of Pack method:

  • anchor = This is used to give position like 'sw' means south west 'se' etc. we have to define side while using anchor
  • side = top,bottom,left,right etc.
  • padx = use to give padding to box in the x direction from main window (like margin)
  • pady = use to give padding to box in the y direction from main window (like margin)
  • fill = X , Y = this is used to stretch the box according to size of window. We must have to define side while using fill. 














Comments

Popular posts from this blog

#2 Library Management Software

#3 Water remainder Programme