tkinter: tk.grid columnspan

Rich Shepard rshepard at appl-ecosys.com
Wed Jun 5 16:45:14 EDT 2019


In one row of a grid layout I have these two input widgets:

 	self.inputs['name'] = LabelInput(
             self, 'Site Name',
             input_var=tk.StringVar(),
             )
         self.inputs['name'].grid(sticky=tk.W, row=0, column=0)

         self.inputs['description'] = LabelInput(
             self, 'Site Description',
             input_var=tk.StringVar(),
         )
         self.inputs['description'].grid(row=0, column=1, columnspan=2)

I want the second one (description) to be wider and thought the columnspan
option would do the job. It does not. I've read several web pages on the
tk.grid without seeing the proper way of making a stringvar wider than a
single grid cell.

Please teach me how to make a tk.StingVar cover two columns in a grid
layout.

TIA,

Rich



More information about the Python-list mailing list