diff options
author | JP Rosevear <jpr@novell.com> | 2004-11-26 23:15:36 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2004-11-26 23:15:36 +0800 |
commit | ba0bc7dff09ade6b8014183c44c4c44b42ed1396 (patch) | |
tree | 0394c1dde4cb58e40b4694e0a486f5e37f147750 /widgets/misc/e-combo-button.c | |
parent | f484ce17b3651e8d741e789621f59baef1652974 (diff) | |
download | gsoc2013-evolution-ba0bc7dff09ade6b8014183c44c4c44b42ed1396.tar gsoc2013-evolution-ba0bc7dff09ade6b8014183c44c4c44b42ed1396.tar.gz gsoc2013-evolution-ba0bc7dff09ade6b8014183c44c4c44b42ed1396.tar.bz2 gsoc2013-evolution-ba0bc7dff09ade6b8014183c44c4c44b42ed1396.tar.lz gsoc2013-evolution-ba0bc7dff09ade6b8014183c44c4c44b42ed1396.tar.xz gsoc2013-evolution-ba0bc7dff09ade6b8014183c44c4c44b42ed1396.tar.zst gsoc2013-evolution-ba0bc7dff09ade6b8014183c44c4c44b42ed1396.zip |
test prog
2004-11-26 JP Rosevear <jpr@novell.com>
* test-info-label.c: test prog
* e-url-entry.c: get image directly from icon factory
* e-combo-button.c: ditto; convert to G_DEFINE_TYPE
* e-activity-handler.c: convert to G_DEFINE_TYPE
* e-task-widget.c: ditto
* e-task-bar.c: ditto
* e-multi-config-dialog.c: ditto
* e-dropdown-button.c: ditto
* e-cell-renderer-combo.c: ditto
* e-cell-date-edit.c: ditto
* e-calendar.c: ditto
* e-calendar-item.c: ditto
* Makefile.am: don't build the title bar, build an info label test
program
svn path=/trunk/; revision=27999
Diffstat (limited to 'widgets/misc/e-combo-button.c')
-rw-r--r-- | widgets/misc/e-combo-button.c | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index e336e88906..66706c1f21 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -34,9 +34,6 @@ #include <gtk/gtkimage.h> #include <gtk/gtksignal.h> -#include <gal/util/e-util.h> - - struct _EComboButtonPrivate { GdkPixbuf *icon; @@ -50,13 +47,8 @@ struct _EComboButtonPrivate { gboolean menu_popped_up; }; - #define SPACING 2 - -#define PARENT_TYPE gtk_button_get_type () -static GtkButtonClass *parent_class = NULL; - enum { ACTIVATE_DEFAULT, LAST_SIGNAL @@ -64,23 +56,9 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; - -/* Utility functions. */ - -static GtkWidget * -create_empty_image_widget (void) -{ - GtkWidget *image_widget; - GdkPixbuf *pixbuf; +G_DEFINE_TYPE (EComboButton, e_combo_button, GTK_TYPE_BUTTON) - pixbuf = e_icon_factory_get_icon (NULL, E_ICON_SIZE_MENU); - - image_widget = gtk_image_new_from_pixbuf (pixbuf); - - g_object_unref (pixbuf); - - return image_widget; -} +/* Utility functions. */ static void set_icon (EComboButton *combo_button, @@ -269,7 +247,7 @@ impl_destroy (GtkObject *object) combo_button->priv = NULL; } - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + (* GTK_OBJECT_CLASS (e_combo_button_parent_class)->destroy) (object); } @@ -323,7 +301,7 @@ impl_leave_notify_event (GtkWidget *widget, have just popped up the menu. Otherwise, the button would look as inactive when the menu is popped up. */ if (! priv->menu_popped_up) - return (* GTK_WIDGET_CLASS (parent_class)->leave_notify_event) (widget, event); + return (* GTK_WIDGET_CLASS (e_combo_button_parent_class)->leave_notify_event) (widget, event); return FALSE; } @@ -392,13 +370,13 @@ impl_released (GtkButton *button) static void -class_init (GtkObjectClass *object_class) +e_combo_button_class_init (EComboButtonClass *combo_button_class) { + GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkButtonClass *button_class; - parent_class = g_type_class_ref(PARENT_TYPE); - + object_class = GTK_OBJECT_CLASS (combo_button_class); object_class->destroy = impl_destroy; widget_class = GTK_WIDGET_CLASS (object_class); @@ -418,7 +396,7 @@ class_init (GtkObjectClass *object_class) } static void -init (EComboButton *combo_button) +e_combo_button_init (EComboButton *combo_button) { EComboButtonPrivate *priv; @@ -429,7 +407,7 @@ init (EComboButton *combo_button) gtk_container_add (GTK_CONTAINER (combo_button), priv->hbox); gtk_widget_show (priv->hbox); - priv->icon_image = create_empty_image_widget (); + priv->icon_image = e_icon_factory_get_image (NULL, E_ICON_SIZE_MENU); gtk_box_pack_start (GTK_BOX (priv->hbox), priv->icon_image, TRUE, TRUE, 0); gtk_widget_show (priv->icon_image); @@ -531,6 +509,3 @@ e_combo_button_set_menu (EComboButton *combo_button, G_CALLBACK (menu_deactivate_callback), combo_button); } - - -E_MAKE_TYPE (e_combo_button, "EComboButton", EComboButton, class_init, init, PARENT_TYPE) |