summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 338c718)
raw | patch | inline | side by side (parent: 338c718)
author | jrreinhard <jrreinhard@users.sourceforge.net> | |
Thu, 26 Jul 2007 20:25:47 +0000 (20:25 +0000) | ||
committer | jrreinhard <jrreinhard@users.sourceforge.net> | |
Thu, 26 Jul 2007 20:25:47 +0000 (20:25 +0000) |
src/interface.cpp | patch | blob | history |
diff --git a/src/interface.cpp b/src/interface.cpp
index ea08f170c65b0cf4c14a69e53a6f3231faf0f927..f43c31d301b9725cf955a76176bce70002f68afe 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -1402,9 +1402,19 @@ sp_ui_menu_item_set_sensitive(SPAction *action, unsigned int sensitive, void *da
static void
sp_ui_menu_item_set_name(SPAction *action, Glib::ustring name, void *data)
{
- gtk_label_set_markup_with_mnemonic(
- GTK_LABEL (gtk_container_get_children(GTK_CONTAINER (GTK_BIN (data)->child))->data),
+ void *child = GTK_BIN (data)->child;
+ //child is either
+ //- a GtkHBox, whose first child is a label displaying name if the menu
+ //item has an accel key
+ //- a GtkLabel if the menu has no accel key
+ if (GTK_IS_LABEL(child)) {
+ gtk_label_set_markup_with_mnemonic(GTK_LABEL (child), name.c_str());
+ } else if (GTK_IS_HBOX(child)) {
+ gtk_label_set_markup_with_mnemonic(
+ GTK_LABEL (gtk_container_get_children(GTK_CONTAINER (child))->data),
name.c_str());
+ }//else sp_ui_menu_append_item_from_verb has been modified and can set
+ //a menu item in yet another way...
}