How to get GtkAccelLable from menu item

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

 



I've been trying to set custom text for a menu item accelerator text.
Code is something like this (based on some "googled" posts).
 
 menu_item = gtk_menu_item_new_with_label(_("Insert Node"));
 g_signal_connect(menu_item, "activate", G_CALLBACK (on_menu_insert_node), NULL);
 gtk_menu_append(menu, menu_item);
 gtk_widget_show (menu_item);
 //set accelerator string
 GtkAccelLabel *accel_label = GTK_ACCEL_LABEL( gtk_bin_get_child( GTK_BIN( menu_item ) ) ); 
 gtk_label_set_text( GTK_LABEL(accel_label), "Ins" );
 
But, my problem is that this doesn't work. It seems that gtk_bin_get_child returns main item label, but not  GtkAccelLabel.
Does anyone know how can it be achieved ?
 
Regards,
  Miroslav Rajcic
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux