Commit fe0b6370 authored by Jan Djärv's avatar Jan Djärv

* gtkutil.c (xg_make_tool_item): Add callbacks of one of wimage or

label is not null.
(xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
may be NULL.

Fixes: debbugs:9951
parent 89bd5ee1
2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (xg_make_tool_item): Add callbacks of one of wimage or
label is not null (Bug#9951).
(xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
may be NULL.
2011-11-04 Eli Zaretskii <eliz@gnu.org>
* window.c (Fwindow_body_size): Mention in the doc string that the
......
......@@ -4237,7 +4237,7 @@ xg_make_tool_item (FRAME_PTR f,
gtk_container_add (GTK_CONTAINER (weventbox), wb);
gtk_container_add (GTK_CONTAINER (ti), weventbox);
if (wimage)
if (wimage || label)
{
intptr_t ii = i;
gpointer gi = (gpointer) ii;
......@@ -4302,21 +4302,21 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage);
/* Check if the tool icon matches. */
if (stock_name)
if (stock_name && wimage)
{
old = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_STOCK_NAME);
if (!old || strcmp (old, stock_name))
return 1;
}
else if (icon_name)
else if (icon_name && wimage)
{
old = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_ICON_NAME);
if (!old || strcmp (old, icon_name))
return 1;
}
else
else if (wimage)
{
gpointer gold_img = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_IMAGE_DATA);
......@@ -4331,7 +4331,7 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
return 1;
/* Ensure label is correct. */
if (label)
if (label && wlbl)
gtk_label_set_text (GTK_LABEL (wlbl), label);
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment