tkinter grid() question

Garrett G. Hodgson garry at research.att.com
Tue Nov 2 13:28:02 EST 1999


in the code below, i create a Text entry area with a Scrollbar.
i want this pair to always use all of the available space.
but when i resize the window, the stay the same size, neither
expanding or shrinking.

what am i doing wrong?

thanks

--------------------
from Tkinter import *

class Bug(Frame):
	def __init__( self, parent ):
		Frame.__init__( self, parent )
		self.pack( fill=BOTH )

		scrollbar = Scrollbar( self, orient=VERTICAL )
		self.body = Text( self )

		self.body.config( yscrollcommand=scrollbar.set )
		self.body.grid( row=2, column=0, rowspan=10, columnspan=10, sticky=N+S
)
		scrollbar.config( command=self.body.yview )
		scrollbar.grid( row=2, column=10, rowspan=10, sticky=N+S )

if __name__ == '__main__':
	root = Tk()
	Bug( root )
	root.mainloop()

-- 
Garry Hodgson			"Hey, mister, can ya tell me,
garry at sage.att.com		where a man might find a bed?"
Software Innovation Services	He just grinned and shook my hand,
AT&T Labs			"No", was all he said.




More information about the Python-list mailing list