don't call gtk_radio_tool_button_new_with_stock_from_widget() with a NULL

2004-12-14  Sven Neumann  <sven@gimp.org>

	* plug-ins/imagemap/imap_misc.c (make_toolbar_radio_icon): don't
	call gtk_radio_tool_button_new_with_stock_from_widget() with a
	NULL widget. Fixes bug #161210.
This commit is contained in:
Sven Neumann 2004-12-14 01:03:14 +00:00 committed by Sven Neumann
parent e99ab31376
commit 0e62110271
2 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2004-12-14 Sven Neumann <sven@gimp.org>
* plug-ins/imagemap/imap_misc.c (make_toolbar_radio_icon): don't
call gtk_radio_tool_button_new_with_stock_from_widget() with a
NULL widget. Fixes bug #161210.
2004-12-14 Sven Neumann <sven@gimp.org>
* configure.in: added GIMP_API_VERSION to the generated gimpversion.h.

View File

@ -60,7 +60,7 @@ make_toolbar_stock_icon(GtkWidget *toolbar, const gchar *stock_id,
{
GtkToolItem *item = gtk_tool_button_new_from_stock (stock_id);
g_signal_connect (item, "clicked", G_CALLBACK (callback), udata);
return make_toolbar_icon (toolbar, item, identifier, tooltip,
return make_toolbar_icon (toolbar, item, identifier, tooltip,
callback, udata);
}
@ -71,12 +71,17 @@ make_toolbar_radio_icon(GtkWidget *toolbar, const gchar *stock_id,
void (*callback)(GtkWidget*, gpointer),
gpointer udata)
{
GtkToolItem *item =
gtk_radio_tool_button_new_with_stock_from_widget
(GTK_RADIO_TOOL_BUTTON (prev), stock_id);
g_signal_connect (item, "toggled", G_CALLBACK (callback), udata);
return make_toolbar_icon (toolbar, item, identifier, tooltip,
callback, udata);
GtkToolItem *item;
if (prev)
item = gtk_radio_tool_button_new_with_stock_from_widget
(GTK_RADIO_TOOL_BUTTON (prev), stock_id);
else
item = gtk_radio_tool_button_new_from_stock (NULL, stock_id);
g_signal_connect (item, "toggled", G_CALLBACK (callback), udata);
return make_toolbar_icon (toolbar, item, identifier, tooltip,
callback, udata);
}
GtkWidget*
@ -87,7 +92,7 @@ make_toolbar_toggle_icon(GtkWidget *toolbar, const gchar *stock_id,
{
GtkToolItem *item = gtk_toggle_tool_button_new_from_stock (stock_id);
g_signal_connect (item, "toggled", G_CALLBACK (callback), udata);
return make_toolbar_icon (toolbar, item, identifier, tooltip,
return make_toolbar_icon (toolbar, item, identifier, tooltip,
callback, udata);
}