summaryrefslogtreecommitdiff
path: root/gtk/gtkitem.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@gtk.org>1998-04-30 15:18:19 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-04-30 15:18:19 +0000
commit8850ce814d28f0e70e8e0f6a5699530dd1ef9983 (patch)
treebe09b8ad9dccd4240df266f67c9ac96628d1594f /gtk/gtkitem.c
parent32e8dc45b03e667e2181b2d3239e26326f94d505 (diff)
downloadgtk+-8850ce814d28f0e70e8e0f6a5699530dd1ef9983.tar.gz
Allow the user to use the popup list like a menu.
Thu Apr 30 11:18:00 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtkcombo.[ch]: Allow the user to use the popup list like a menu. * gtk/gtkmenuitem.c gtk/gtkitem.c: Moved enter/leave handlers to gtkitem.c so dragging can also work in lists. * gtk/gtklist.[ch]: Track child enter events and use those to allow dragging the selection. Thu Apr 30 11:16:06 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtktext.c: Try enabling background pixmaps for editable text widgets. There is a bit of flashing, but not too bad. If you don't want the flashing, you can always not set a background pixmap. Wed Apr 29 15:46:13 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtktext.c: Fixed a bug where the drawn level was being messed up when the text was scrolled during a deletion.
Diffstat (limited to 'gtk/gtkitem.c')
-rw-r--r--gtk/gtkitem.c39
1 files changed, 34 insertions, 5 deletions
diff --git a/gtk/gtkitem.c b/gtk/gtkitem.c
index 32477c238e..0b6b5f5e97 100644
--- a/gtk/gtkitem.c
+++ b/gtk/gtkitem.c
@@ -28,11 +28,15 @@ enum {
};
-static void gtk_item_class_init (GtkItemClass *klass);
-static void gtk_item_init (GtkItem *item);
-static void gtk_item_map (GtkWidget *widget);
-static void gtk_item_unmap (GtkWidget *widget);
-static void gtk_item_realize (GtkWidget *widget);
+static void gtk_item_class_init (GtkItemClass *klass);
+static void gtk_item_init (GtkItem *item);
+static void gtk_item_map (GtkWidget *widget);
+static void gtk_item_unmap (GtkWidget *widget);
+static void gtk_item_realize (GtkWidget *widget);
+static gint gtk_item_enter (GtkWidget *widget,
+ GdkEventCrossing *event);
+static gint gtk_item_leave (GtkWidget *widget,
+ GdkEventCrossing *event);
static guint item_signals[LAST_SIGNAL] = { 0 };
@@ -99,6 +103,8 @@ gtk_item_class_init (GtkItemClass *class)
widget_class->map = gtk_item_map;
widget_class->unmap = gtk_item_unmap;
widget_class->realize = gtk_item_realize;
+ widget_class->enter_notify_event = gtk_item_enter;
+ widget_class->leave_notify_event = gtk_item_leave;
class->select = NULL;
class->deselect = NULL;
@@ -192,3 +198,26 @@ gtk_item_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
}
+
+static gint
+gtk_item_enter (GtkWidget *widget,
+ GdkEventCrossing *event)
+{
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (GTK_IS_ITEM (widget), FALSE);
+ g_return_val_if_fail (event != NULL, FALSE);
+
+ return gtk_widget_event (widget->parent, (GdkEvent*) event);
+}
+
+static gint
+gtk_item_leave (GtkWidget *widget,
+ GdkEventCrossing *event)
+{
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (GTK_IS_ITEM (widget), FALSE);
+ g_return_val_if_fail (event != NULL, FALSE);
+
+ return gtk_widget_event (widget->parent, (GdkEvent*) event);
+}
+