aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2011-11-04 19:18:05 +0100
committerJan Djärv2011-11-04 19:18:05 +0100
commitfe0b6370b7415d81b575bac22caea623aa69c9c1 (patch)
tree5b924ccc7b3db1f4431d925115a475a639bf2d17 /src
parent89bd5ee15acb93aefd403f3c76d1aff57520608b (diff)
downloademacs-fe0b6370b7415d81b575bac22caea623aa69c9c1.tar.gz
emacs-fe0b6370b7415d81b575bac22caea623aa69c9c1.zip
* 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
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/gtkutil.c10
2 files changed, 12 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ccfcb48daf0..b03c609f907 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12011-11-04 Jan Djärv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (xg_make_tool_item): Add callbacks of one of wimage or
4 label is not null (Bug#9951).
5 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
6 may be NULL.
7
12011-11-04 Eli Zaretskii <eliz@gnu.org> 82011-11-04 Eli Zaretskii <eliz@gnu.org>
2 9
3 * window.c (Fwindow_body_size): Mention in the doc string that the 10 * window.c (Fwindow_body_size): Mention in the doc string that the
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 26959d57d4b..af697c72673 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -4237,7 +4237,7 @@ xg_make_tool_item (FRAME_PTR f,
4237 gtk_container_add (GTK_CONTAINER (weventbox), wb); 4237 gtk_container_add (GTK_CONTAINER (weventbox), wb);
4238 gtk_container_add (GTK_CONTAINER (ti), weventbox); 4238 gtk_container_add (GTK_CONTAINER (ti), weventbox);
4239 4239
4240 if (wimage) 4240 if (wimage || label)
4241 { 4241 {
4242 intptr_t ii = i; 4242 intptr_t ii = i;
4243 gpointer gi = (gpointer) ii; 4243 gpointer gi = (gpointer) ii;
@@ -4302,21 +4302,21 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
4302 GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage); 4302 GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage);
4303 4303
4304 /* Check if the tool icon matches. */ 4304 /* Check if the tool icon matches. */
4305 if (stock_name) 4305 if (stock_name && wimage)
4306 { 4306 {
4307 old = g_object_get_data (G_OBJECT (wimage), 4307 old = g_object_get_data (G_OBJECT (wimage),
4308 XG_TOOL_BAR_STOCK_NAME); 4308 XG_TOOL_BAR_STOCK_NAME);
4309 if (!old || strcmp (old, stock_name)) 4309 if (!old || strcmp (old, stock_name))
4310 return 1; 4310 return 1;
4311 } 4311 }
4312 else if (icon_name) 4312 else if (icon_name && wimage)
4313 { 4313 {
4314 old = g_object_get_data (G_OBJECT (wimage), 4314 old = g_object_get_data (G_OBJECT (wimage),
4315 XG_TOOL_BAR_ICON_NAME); 4315 XG_TOOL_BAR_ICON_NAME);
4316 if (!old || strcmp (old, icon_name)) 4316 if (!old || strcmp (old, icon_name))
4317 return 1; 4317 return 1;
4318 } 4318 }
4319 else 4319 else if (wimage)
4320 { 4320 {
4321 gpointer gold_img = g_object_get_data (G_OBJECT (wimage), 4321 gpointer gold_img = g_object_get_data (G_OBJECT (wimage),
4322 XG_TOOL_BAR_IMAGE_DATA); 4322 XG_TOOL_BAR_IMAGE_DATA);
@@ -4331,7 +4331,7 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
4331 return 1; 4331 return 1;
4332 4332
4333 /* Ensure label is correct. */ 4333 /* Ensure label is correct. */
4334 if (label) 4334 if (label && wlbl)
4335 gtk_label_set_text (GTK_LABEL (wlbl), label); 4335 gtk_label_set_text (GTK_LABEL (wlbl), label);
4336 return 0; 4336 return 0;
4337} 4337}