New widget from GtkScrolledWindow



Hi,

I'm making a new widget object that inheritances from GtkScrolledWindow.

This is part of code:

struct _mywidgetClass {
	GtkScrolledWindowClass parent_class;
};

struct _mywidget {
	GtkScrolledWindow scrolledwindow;
	
  	GtkWidget *treeview;
  	GtkListStore *liststore;
  	GtkTreeIter iter;
  	
	guint lines;
};

GtkWidget *my_widget_new(void)
{
	MyWidget *my_widget;

	my_widget = g_object_new(my_widget_get_type(), NULL);

	return GTK_WIDGET(my_widget);
}

GType my_widget_get_type(void)
{
	static GType type = 0;

	if (!type)
	{
		static const GTypeInfo info =
		{
			sizeof (mywidgetClass),	/* class_size; */
			NULL,	/* base_init */
			NULL,	/* base_finalise */
			my_widget_class_init,	/* class_init */
			NULL,	/* class_finalise */
			NULL,	/* class_data */
			sizeof(mywidget),	/* instance_size; */
			0,	/* n_preallocs */
			my_widget_process_init	/* instance_init */
		};

		type = g_type_register_static(GTK_TYPE_SCROLLED_WINDOW,	"MyWidget", &info, 0);
	}

	return type;
}

program works fine, but in runtime it returns this error:

Gtk-CRITICAL **: gtk_range_get_adjustment: assertion `GTK_IS_RANGE (range)' failed


Have you any idea to fix this error?

Thank you very much
Giulio
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Sono aperte le iscrizioni per il corso Nazionale di Web Marketing
* Imparerai come promuoverti sui motori di ricerca - clicca qui
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3215&d=6-3



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