From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: gtk-menu-popup [guile-gnome2 2.16.1-4] Date: Tue, 29 Jun 2010 12:04:27 +0200 Message-ID: References: <20100628161537.1669886d@rascar> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1277805738 10448 80.91.229.12 (29 Jun 2010 10:02:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 29 Jun 2010 10:02:18 +0000 (UTC) Cc: guile-user To: David Pirotte Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jun 29 12:02:15 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OTXdr-00045h-3B for guile-user@m.gmane.org; Tue, 29 Jun 2010 12:02:11 +0200 Original-Received: from localhost ([127.0.0.1]:58349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTXdq-0002Qt-CM for guile-user@m.gmane.org; Tue, 29 Jun 2010 06:02:10 -0400 Original-Received: from [140.186.70.92] (port=57353 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTXdg-0002Py-NB for guile-user@gnu.org; Tue, 29 Jun 2010 06:02:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTXde-0006mF-VS for guile-user@gnu.org; Tue, 29 Jun 2010 06:02:00 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:62232 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTXde-0006mB-R4 for guile-user@gnu.org; Tue, 29 Jun 2010 06:01:58 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 43423C0CDB; Tue, 29 Jun 2010 06:01:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=hEvPcajgWmao2IuCNvbO+Ql0//o=; b=rWAJIA 5IOE6pRWLmraElJzqFc7TpUTUXR4yNUtOEN2G+fiKSBH1pD0V2duOirE2KYCz6SC uyhjsOqRhYwTUYZZkfRixCc2w4dhzp0xLCJxxraPm/CEd4qn6erFfwpJOH+AEGH5 pdZ+fibpNPLnmSlmEVOb4Dd0fNwe53FEN5VJs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ils4DPXwXB6n1gr57L7KN16MApCFTxM5 VJ1tH4Q2Z2wk8pit85c8uXSS1Dp8rvRB+Rcm9grPiKSW5OKrDs1hwM8tpRICaFe7 HxoOBLb4oNt6M5BpVRa0gb7MvtXHRSjL42iNLtf7DrIon5D9VHdeIil73iLzpP5c Qlxp9/Q/mow= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 2E688C0CD9; Tue, 29 Jun 2010 06:01:57 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [83.202.24.141]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 8FA4EC0CD8; Tue, 29 Jun 2010 06:01:55 -0400 (EDT) In-Reply-To: <20100628161537.1669886d@rascar> (David Pirotte's message of "Mon, 28 Jun 2010 16:15:37 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 5A23A324-8365-11DF-9F45-9056EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7935 Archived-At: Hi David, On Mon 28 Jun 2010 21:15, David Pirotte writes: > (gtk-menu-popup popup-menu > #f ;; parent-menu-shell or #f > #f ;; parent-menu-item or #f > #f ;; user supplied func to position the menu or #f > #f ;; user supplied data to pass to func > button > time) This function did change API when going from guile-gnome-0 to guile-gnome-2. I paste below the commit that re-added gtk-menu-popup to guile-gnome-gtk. As you can see the prototype is different -- no user data to the positioning function. Cheers, Andy Parent: b5bfe47421b32f5fc8684725f18be2cd50f07748 (2007-12-17 Jan Nieuwenhuizen ) Child: 3c4f31cba340a85f6545409a409f53a4a401f393 (Update NEWS for release) Branches: gtk, remotes/origin/gtk Follows: Precedes: 2008-04-10 Andy Wingo * gnome/overrides/gtk.defs (popup): * gnome/gw/gtk-support.h: * gnome/gw/gtk-support.c (menu_position_fn) (_wrap_gtk_menu_popup): Wrap gtk-menu-popup, with a scheme positioning function and no user-data argument. ---------------------------------- ChangeLog ---------------------------------- index 96f736c..5d828a0 100644 @@ -1,3 +1,11 @@ +2008-04-10 Andy Wingo + + * gnome/overrides/gtk.defs (popup): + * gnome/gw/gtk-support.h: + * gnome/gw/gtk-support.c (menu_position_fn) + (_wrap_gtk_menu_popup): Wrap gtk-menu-popup, with a scheme + positioning function and no user-data argument. + 2007-12-17 Jan Nieuwenhuizen * gnome/gw/gtk-support.h: ---------------------------- gnome/gw/gtk-support.c ---------------------------- index cc0c17f..998f8a1 100644 @@ -413,6 +413,33 @@ _wrap_gtk_list_store_append (GtkListStore *store) return new; } +static void +menu_position_fn (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, + gpointer data) +{ + SCM ret, proc = GPOINTER_TO_SCM (data); + + ret = scm_call_1 (proc, scm_c_gtype_instance_to_scm (menu)); + + *x = scm_to_int32 (scm_car (ret)); + *y = scm_to_int32 (scm_cadr (ret)); + *push_in = scm_is_true (scm_caddr (ret)); +} + +void +_wrap_gtk_menu_popup (GtkMenu *menu, GtkWidget *parent_menu_shell, + GtkWidget *parent_menu_item, SCM func, + guint button, guint32 activate_time) +{ + if (scm_is_true (func)) + gtk_menu_popup (menu, parent_menu_shell, parent_menu_item, + menu_position_fn, SCM_TO_GPOINTER (func), + button, activate_time); + else + gtk_menu_popup (menu, parent_menu_shell, parent_menu_item, + NULL, NULL, button, activate_time); +} + /* FIXME: is this still necessary? */ SCM _wrap_gtk_message_dialog_new (GtkWindow* parent, GtkDialogFlags flags, GtkMessageType type, ---------------------------- gnome/gw/gtk-support.h ---------------------------- index 71cde36..0326cd1 100644 @@ -59,6 +59,10 @@ GtkTreeIter* _wrap_gtk_list_store_insert_after (GtkListStore *store, GtkTreeIter GtkTreeIter* _wrap_gtk_list_store_prepend (GtkListStore *store); GtkTreeIter* _wrap_gtk_list_store_append (GtkListStore *store); +void _wrap_gtk_menu_popup (GtkMenu *menu, GtkWidget *parent_menu_shell, + GtkWidget *parent_menu_item, SCM func, + guint button, guint32 activate_time); + SCM _wrap_gtk_message_dialog_new (GtkWindow* parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *text); gchar* _gtk_selection_data_get_as_string (GtkSelectionData *data); --------------------------- gnome/overrides/gtk.defs --------------------------- index 8edb1fd..e69a5a2 100644 @@ -303,6 +303,21 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; GtkMenu +(define-method popup + (of-object "GtkMenu") + (c-name "_wrap_gtk_menu_popup") + (overrides "gtk_menu_popup") + (return-type "none") + (leave-guile-mode #f) + (parameters + '("GtkWidget*" "parent_menu_shell" (null-ok)) + '("GtkWidget*" "parent_menu_item" (null-ok)) + '("SCM" "menu_position_func") + '("guint" "button") + '("guint32" "activate_time") + ) +) + (define-function gtk_menu_get_for_attach_widget (c-name "gtk_menu_get_for_attach_widget") (overrides "gtk_menu_get_for_attach_widget") @@ -1100,7 +1115,6 @@ "gtk_list_unselect_child" "gtk_list_unselect_item" "gtk_menu_attach_to_widget" - "gtk_menu_popup" "gtk_message_dialog_format_secondary_markup" "gtk_message_dialog_format_secondary_text" "gtk_notebook_query_tab_label_packing" -- http://wingolog.org/