X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/a92553bd87d94b64654a70a7293b3d46cfec4595..8ef4708822a3efcab209815d66ae2433d93a6433:/gtk/gtk.lisp diff --git a/gtk/gtk.lisp b/gtk/gtk.lisp index 35fd7f5..6a95c27 100644 --- a/gtk/gtk.lisp +++ b/gtk/gtk.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtk.lisp,v 1.54 2006/02/19 19:31:14 espen Exp $ +;; $Id: gtk.lisp,v 1.56 2006/02/26 21:19:02 espen Exp $ (in-package "GTK") @@ -695,8 +695,8 @@ #+gtk2.6 (defbinding (dialog-set-alternative-button-order - "gtk_dialog_set_alternative_button_order_from_array") - (dialog new-order) + "gtk_dialog_set_alternative_button_order_from_array") + (dialog new-order) nil (dialog dialog) ((length new-order) int) ((map 'vector #'(lambda (response) @@ -1202,6 +1202,16 @@ (initial-add window #'window-add-accel-group initargs :accel-group :accel-groups))) +#-debug-ref-counting +(defmethod print-object ((window window) stream) + (if (and + (proxy-valid-p window) + (slot-boundp window 'title) + (not (zerop (length (window-title window))))) + (print-unreadable-object (window stream :type t :identity nil) + (format stream "~S at 0x~X" + (window-title window) (sap-int (foreign-location window)))) + (call-next-method))) (defbinding window-set-wmclass () nil (window window) @@ -1825,7 +1835,7 @@ (define-callback %menu-detach-callback nil ((widget widget) (menu menu)) (funcall (object-data menu 'detach-func) widget menu)) -(defbinding %menu-attach-to-widget () nil +(defbinding %menu-attach-to-widget (menu widget) nil (menu menu) (widget widget) (%menu-detach-callback callback)) @@ -2235,13 +2245,22 @@ (location pointer)) (defun stock-lookup (stock-id) - (let ((location - (allocate-memory (foreign-size (find-class 'stock-item))))) - (unwind-protect - (when (%stock-lookup stock-id location) - (ensure-proxy-instance 'stock-item (%stock-item-copy location))) - (deallocate-memory location)))) + (with-allocated-memory (stock-item (foreign-size (find-class 'stock-item))) + (when (%stock-lookup stock-id stock-item) + (ensure-proxy-instance 'stock-item (%stock-item-copy stock-item))))) + +#+gtk2.8 +(progn + (define-callback-marshal %stock-translate-callback string ((path string))) + (defbinding (stock-set-translate-function "gtk_stock_set_translate_func") + (domain function) nil + (domain string) + (%stock-translate-callback callback) + ((register-callback-function function) unsigned-int) + (user-data-destroy-callback callback))) + + ;;; Tooltips