A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/python/tk_grid.htm below:

Tkinter grid() Method

Tkinter grid() Method

This geometry manager organizes widgets in a table-like structure in the parent widget.

Syntax
widget.grid( grid_options )

Here is the list of possible options −

Example

Try the following example by moving cursor on different buttons −

from tkinter import *
root = Tk( )
b=0
   for r in range(6):
      for c in range(6):
         b=b+1
         Button(root, text=str(b),
            borderwidth=1 ).grid(row=r,column=c)
root.mainloop()

This would produce the following result displaying 12 labels arrayed in a 3 x 4 grid −

python_gui_programming.htm


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4