Help: gtk_widget_set_sensitive error



I wrote a very simple routine to test toggling the image and text of a toolbar. In the proces I also tried to deactivate and hind some of the toolbar icons. I have a toolbar as such:

GnomeUIInfo toolbar[] = {
	GNOMEUIINFO_ITEM_STOCK("test1", "test_1_func",
	                      test_1_func, GNOME_STOCK_PIXMAP_NEW),
	GNOMEUIINFO_SEPARATOR,
	GNOMEUIINFO_ITEM_STOCK("test2", "test 2 func",
	                      test_2_func, GNOME_STOCK_PIXMAP_NEW),
	GNOMEUIINFO_END
};

and in test1 function I use the following function to grey-out the second button on the toolbar.

gtk_widget_set_sensitive(GTK_WIDGET(toolbar[1].widget), TRUE);

When I press button1 I get the following error instead:

Gtk-WARNING **: invalid cast from (NULL) pointer to `GtkWidget'

Gtk-CRITICAL **: file gtkwidget.c: line 3312 (gtk_widget_set_sensitive): assertion `widget != NULL' failed.


Any insight into this would be very much appreciated.

Thanks in advance.

-D


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





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