Re: bonobo control problem



On Sat, 2003-03-01 at 23:48, Stephen M. Przepiora wrote:
> I am trying to learn how to make a bonobo control and created a simple
> one that just makes a label. The test container I wrote seems to work
> fine with other controls so I have been concentrating on the control I
> wrote.
> 
> The error I am getting is:
> (bonobo_test:5752): Bonobo-CRITICAL **: file bonobo-object.c: line 286
> (bonobo_object_unref): assertion `ao != NULL' failed
> 
> 
> The code for the control is small so I am pasting it in here:
> 
> 
> #define OAFIID "OAFIID:Bonobo_Test_Label"
> 
> static BonoboObject* factory_fn (BonoboGenericFactory *this, const char
> *object_id, void *data)
> {
> 	GtkWidget *label = NULL;
> 	BonoboObject *object = NULL;
> 	label = gtk_label_new ("foo");
> 	gtk_widget_show (label);
> 	return BONOBO_OBJECT (label);
> }
> 
this is wrong, a GtkLabel is not a BonoboObject. You should do:

	label = gtk_label_new ("foo");
	BonoboControl *control = bonobo_control_new (label);
	return BONOBO_OBJECT (control);

cheers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]