Commit
avoid deprecated: gtk_image_menu_item_new_with_mnemonic gtk_image_menu_item_set_image
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,3 +159,27 @@ panel_file_chooser_dialog_new (const gchar *title, | |
|
||
return result; | ||
} | ||
|
||
GtkWidget * | ||
panel_image_menu_item_new_from_icon (const gchar *icon_name, | ||
const gchar *label_name) | ||
{ | ||
GtkWidget *icon; | ||
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); | ||
|
||
if (icon_name) | ||
icon = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); | ||
else | ||
icon = gtk_image_new (); | ||
|
||
GtkWidget *label_menu = gtk_label_new_with_mnemonic (g_strconcat (label_name, " ", NULL)); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
GtkWidget *menuitem = gtk_menu_item_new (); | ||
|
||
gtk_container_add (GTK_CONTAINER (box), icon); | ||
gtk_container_add (GTK_CONTAINER (box), label_menu); | ||
|
||
gtk_container_add (GTK_CONTAINER (menuitem), box); | ||
gtk_widget_show_all (menuitem); | ||
|
||
return menuitem; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lukefromdc
Member
|
||
} |
Memory leak...