Commit 114abd32 authored by Paolo Borelli's avatar Paolo Borelli Committed by Paolo Borelli

use gtk_button_set_image to build custom buttons.

2005-07-23  Paolo Borelli  <pborelli@katamail.com>

	* gedit-utils.c: use gtk_button_set_image to build custom
buttons.
parent 4ba15c3f
2005-07-23 Paolo Borelli <pborelli@katamail.com>
* gedit-utils.c: use gtk_button_set_image to build custom buttons.
2005-07-22 Paolo Maggi <paolo@gnome.org>
* gedit-prefs-manager.c (gconf_client_get_string_with_default):
......
......@@ -293,26 +293,17 @@ gedit_utils_is_uri_read_only (const gchar* uri)
return res;
}
/* lifted from eel */
static GtkWidget *
gedit_gtk_button_new_with_stock_icon (const gchar *label, const gchar *stock_id)
{
GtkWidget *button, *l, *image, *hbox, *align;
/* This is mainly copied from gtk_button_construct_child(). */
button = gtk_button_new ();
l = gtk_label_new_with_mnemonic (label);
gtk_label_set_mnemonic_widget (GTK_LABEL (l), GTK_WIDGET (button));
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
hbox = gtk_hbox_new (FALSE, 2);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), l, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (button), align);
gtk_container_add (GTK_CONTAINER (align), hbox);
gtk_widget_show_all (align);
GtkWidget *button;
return button;
button = gtk_button_new_with_mnemonic (label);
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (stock_id,
GTK_ICON_SIZE_BUTTON));
return button;
}
GtkWidget*
......
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