[pygtk] Error in frame-derived class?

Germán Diago Gómez germandiago at gmail.com
Wed May 7 18:44:42 WST 2008


Hello. I'm trying to insert a gtk.Frame derived class into a
gtk.Expander, and when I try to, I get this error:

 assertion `GTK_IS_WIDGET (widget)' failed

But if I insert a gtk.Frame in an expander, the error disappears.
How can I insert a derived gtk.Frame object into a gtk.Expander?


my code is more or less like this:

class TileFotograma(gtk.Frame):	
	def __init__(self, nomfotograma):
		self.__nomfotograma = nomfotograma

		self.image = gtk.Image()
		self.image.set_from_file(self.__nomfotograma)
		self.label =
gtk.Label(self.__nomfotograma.split('_')[-1].split('.')[0])

		self.vbox = gtk.VBox()
		self.add(self.vbox)
		
		self.pack_start(self.image, False, False, 6)


....

class Aplicacion(gtk.Window):

	def __init__(self):
		gtk.Window.__init__(self)
		self.connect("destroy", gtk.main_quit)
		self.set_size_request(640, 480)
		self.set_border_width(6)


		self.expander = gtk.Expander("descanso")
		self.vbox = gtk.VBox()
		
		self.tile = TileFotograma('modificada_goku_cubriendosederecha_0.jpeg')

		self.add(self.vbox)
		
		self.hbox = gtk.HBox()
		self.vbox.pack_start(self.hbox, True, True, 6)

		self.vboxcliente = gtk.VBox()
		
		self.hbox.pack_start(self.vboxcliente, True, True, 6)
		
		self.vboxcliente.pack_start(self.expander, False, False, 6)
		
		#THE ERROR IS HERE. IF I PUT A GTK.FRAME INSTEAD OF ONE OF MY DERIVED
CLASS OBJECT, THE ERROR DISAPPEARS
		self.expander.add(self.tile)





More information about the pygtk mailing list