Setting sizes of widgets (PyGTK)

Harlin Seritt harlinseritt at
Fri Mar 11 10:11:29 CET 2005

I have the following code and I would like to know how to set the
length and width of widgets like Buttons. When the window opens the
button fills up the space even though I have told it not to. Anyone
know how I can accomplish this?


import pygtk, gtk

class Greeter:

	def __init__(self):

		self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) = gtk.VBox()

		self.label = gtk.Label("Please enter your name in the box below:")
		self.namebox = gtk.Entry(12)
		self.button = gtk.Button("Greet Me!")
		self.output = gtk.Label("Your output will appear here."), False, False, 2), False, False, 2), False, False, 2), False, False, 2)
	def main(self):
a = Greeter()

More information about the Python-list mailing list