From ff9c4b4c6361264a5b78b30377312bc48df0d002 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Wed, 3 Nov 2004 10:41:23 +0000 Subject: [PATCH] Callbacks from C done properly Organization: Straylight/Edgeware From: espen --- gtk/gtk.lisp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gtk/gtk.lisp b/gtk/gtk.lisp index 22014c4..d71b327 100644 --- a/gtk/gtk.lisp +++ b/gtk/gtk.lisp @@ -15,7 +15,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;; $Id: gtk.lisp,v 1.13 2004-10-31 12:05:52 espen Exp $ +;; $Id: gtk.lisp,v 1.14 2004-11-03 10:41:23 espen Exp $ (in-package "GTK") @@ -1073,8 +1073,10 @@ (defbinding menu-reorder-child (menu menu-item position) nil (menu-item menu-item) ((%menu-position menu position) int)) -(defvar *menu-position-callback-marshal* - (system:foreign-symbol-address "gtk_menu_position_callback_marshal")) +(def-callback menu-position-callback-marshal + (c-call:void (x c-call:int) (y c-call:int) (push-in c-call:int) + (callback-id c-call:unsigned-int)) + (invoke-callback callback-id nil x y (not (zerop push-in)))) (defbinding %menu-popup () nil (menu menu) @@ -1092,7 +1094,8 @@ (defun menu-popup (menu button activate-time &key callback parent-menu-shell (unwind-protect (%menu-popup menu parent-menu-shell parent-menu-item - *menu-position-callback-marshal* callback-id button activate-time) + (callback menu-position-callback-marshal) + callback-id button activate-time) (destroy-user-data callback-id))) (%menu-popup menu parent-menu-shell parent-menu-item nil 0 button activate-time))) -- [mdw]