Update of /project/cells-gtk/cvsroot/root/gtk-ffi In directory common-lisp.net:/tmp/cvs-serv8536/gtk-ffi
Modified Files: gtk-utilities.lisp Log Message: Use of event button-release-event for popups, because I have failed to get tree-views to send button-press-event. Date: Sat Feb 26 23:44:49 2005 Author: pdenno
Index: root/gtk-ffi/gtk-utilities.lisp diff -u root/gtk-ffi/gtk-utilities.lisp:1.12 root/gtk-ffi/gtk-utilities.lisp:1.13 --- root/gtk-ffi/gtk-utilities.lisp:1.12 Wed Feb 16 23:31:53 2005 +++ root/gtk-ffi/gtk-utilities.lisp Sat Feb 26 23:44:48 2005 @@ -85,18 +85,20 @@ ((widget :pointer-void) (signal (* gdk-event-button)) (data :pointer-void)) (declare (ignorable data)) (let ((event (gdk-event-button-type signal))) - (when (eql (event-type event) :button_press) + (when (or (eql (event-type event) :button_press) + (eql (event-type event) :button_release)) (when (= (gdk-event-button-button signal) 3) (gtk-menu-popup widget nil nil nil nil 3 (gdk-event-button-time signal))))) - 1) + 0)
(defun gtk-widget-set-popup (widget menu) (gtk-signal-connect-swap widget "button-press-event" - (let ((cbl (ffx:ff-register-callable 'button-press-event-handler))) - #+shhtk (print (list "gtk-widget-set-popup connecting callable" widget cbl)) - cbl) - :data menu)) + (ffx:ff-register-callable 'button-press-event-handler) + :data menu) + (gtk-signal-connect-swap widget "button-release-event" + (ffx:ff-register-callable 'button-press-event-handler) + :data menu))
(defun gtk-list-store-new (col-types) (let ((c-types (ffx:fgn-alloc :int (length col-types)))) @@ -196,8 +198,8 @@ (t (cast item (as-gtk-type-name cell-type)))) #+lispworks (case cell-type - (:string (fli:convert-from-foreign-string (fli:dereference item))) - (t (fli:dereference item))) + (:string (fli:convert-from-foreign-string (deref-pointer item))) + (t (deref-pointer item))) #+cmu (case cell-type (:string (alien:cast (alien:deref item) c-call:c-string))