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-completion-test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'widgets/text/e-completion-test.c') diff --git a/widgets/text/e-completion-test.c b/widgets/text/e-completion-test.c index 3172cecb13..f01389363a 100644 --- a/widgets/text/e-completion-test.c +++ b/widgets/text/e-completion-test.c @@ -142,6 +142,12 @@ end_dict_search (ECompletion *complete, gpointer user_data) } } +static void +popup_cb (EEntry *popup, GdkEventButton *ev, gint pos, gpointer user_data) +{ + g_print ("popup at pos %d\n", pos); +} + int main (int argc, gchar **argv) { @@ -172,6 +178,11 @@ main (int argc, gchar **argv) e_entry_enable_completion_full (E_ENTRY (entry), complete, -1, NULL); e_entry_set_editable (E_ENTRY (entry), TRUE); + gtk_signal_connect (GTK_OBJECT (entry), + "popup", + GTK_SIGNAL_FUNC (popup_cb), + NULL); + gtk_container_add (GTK_CONTAINER (win), entry); gtk_widget_show_all (win); -- cgit v1.2.3