From 1bdc6e147f19384e42679512130cfc5f4d93364b Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 6 Mar 2001 00:13:23 +0000 Subject: Set version number to 0.5.99.5 2001-03-05 Jon Trowbridge * configure.in: Set version number to 0.5.99.5 * gal/e-text/e-entry.c (e_entry_class_init): Add a "popup" signal. If you have trepidations about this, see the technical argument below. (e_entry_init): Connect to the EText's popup signal. (e_entry_proxy_popup): Proxy emitter for popup signals from the EText. * gal/e-text/e-text.c (e_text_class_init): Added a "popup" signal. (e_text_event): Emit the "popup" signal on right-clicks. Now you could ask yourself: "should there be a signal named 'popup' in EText that gets emitted on right-clicks?" And this is a reasonable question, since... well, this has a funny feeling to it. But the whole point of GNOME, or at least one of the original points of GNOME, was to impose policy in a reasonable way when it made sense in order to simplify the user's experience. Convention dictates that popup menus are tied to right-clicks --- so rather than setting up some elaborate forwarding of button-press signals, why not just impose a little policy and set up a signal that is closely tied to a familiar set of semantics? Maybe it isn't the best thing to do from a aesthetics-of-the-API point of view, but I doubt anyone could condemn it as being anything more than mostly harmless. svn path=/trunk/; revision=8565 --- widgets/text/e-entry.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'widgets/text/e-entry.c') diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c index 8116895e1c..8c0682e370 100644 --- a/widgets/text/e-entry.c +++ b/widgets/text/e-entry.c @@ -58,6 +58,7 @@ static GtkObjectClass *parent_class; enum { E_ENTRY_CHANGED, E_ENTRY_ACTIVATE, + E_ENTRY_POPUP, E_ENTRY_LAST_SIGNAL }; @@ -100,6 +101,7 @@ struct _EEntryPrivate { guint changed_proxy_tag; guint activate_proxy_tag; + guint popup_proxy_tag; /* Data related to completions */ ECompletion *completion; @@ -214,6 +216,12 @@ e_entry_proxy_activate (EText *text, EEntry *entry) gtk_signal_emit (GTK_OBJECT (entry), e_entry_signals [E_ENTRY_ACTIVATE]); } +static void +e_entry_proxy_popup (EText *text, GdkEventButton *ev, gint pos, EEntry *entry) +{ + gtk_signal_emit (GTK_OBJECT (entry), e_entry_signals [E_ENTRY_POPUP], ev, pos); +} + static void e_entry_init (GtkObject *object) { @@ -272,6 +280,10 @@ e_entry_init (GtkObject *object) "activate", GTK_SIGNAL_FUNC (e_entry_proxy_activate), entry); + entry->priv->popup_proxy_tag = gtk_signal_connect (GTK_OBJECT (entry->priv->item), + "popup", + GTK_SIGNAL_FUNC (e_entry_proxy_popup), + entry); entry->priv->completion_delay = 1; } @@ -1025,6 +1037,13 @@ e_entry_class_init (GtkObjectClass *object_class) gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); + e_entry_signals[E_ENTRY_POPUP] = gtk_signal_new ("popup", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (EEntryClass, popup), + gtk_marshal_NONE__POINTER_INT, + GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_INT); + gtk_object_class_add_signals (object_class, e_entry_signals, E_ENTRY_LAST_SIGNAL); -- cgit v1.2.3