X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/14c94516d638a2549f14b35d4c0dd57bf0fcd038..9706ddd7b4d93a327d83e2bb9e4dcf1de8675245:/gtk/gtk.lisp diff --git a/gtk/gtk.lisp b/gtk/gtk.lisp index 657655f..ca8965b 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.35 2005-02-22 23:07:35 espen Exp $ +;; $Id: gtk.lisp,v 1.40 2005-04-17 21:39:04 espen Exp $ (in-package "GTK") @@ -62,6 +62,17 @@ (setq *max-event-to-usec* 1000)))) +;;; Misc + +(defbinding grab-add () nil + (widget widget)) + +(defbinding grab-get-current () widget) + +(defbinding grab-remove () nil + (widget widget)) + + ;;; About dialog #+gtk2.6 @@ -841,6 +852,12 @@ ;;; Label +(defmethod shared-initialize ((label label) names &key pattern) + (declare (ignore names)) + (call-next-method) + (when pattern + (setf (label-pattern label) pattern))) + (defbinding label-get-layout-offsets () nil (label label) (x int :out) @@ -949,15 +966,19 @@ ;;; Message dialog -(defmethod initialize-instance ((dialog message-dialog) &rest initargs - &key (type :info) (buttons :close) ; or :ok? - flags message parent) - (remf initargs :parent) +(defmethod initialize-instance ((dialog message-dialog) + &key (message-type :info) (buttons :close) + flags text #+gtk 2.6 secondary-text + transient-parent) (setf (slot-value dialog 'location) - (%message-dialog-new parent flags type buttons nil)) - (message-dialog-set-markup dialog message) - (apply #'call-next-method dialog initargs)) + (%message-dialog-new transient-parent flags message-type buttons)) + (when text + (message-dialog-set-markup dialog text)) + #+gtk2.6 + (when secondary-text + (message-dialog-format-secondary-markup dialog secondary-text)) + (call-next-method)) (defbinding %message-dialog-new () pointer @@ -965,14 +986,7 @@ (flags dialog-flags) (type message-type) (buttons buttons-type) - (message (or null string))) - -(defbinding %message-dialog-new-with-markup () pointer - (parent (or null window)) - (flags dialog-flags) - (type message-type) - (buttons buttons-type) - (message string)) + (nil null)) (defbinding message-dialog-set-markup () nil (message-dialog message-dialog) @@ -1336,12 +1350,12 @@ (scrolled-window scrolled-window) (child widget)) -(defmethod initialize-instance ((window scrolled-window) &rest initargs - &key policy) - (if policy - (apply #'call-next-method window - :vscrollbar-policy policy :hscrollbar-policy policy initargs) - (call-next-method))) +(defmethod shared-initialize ((window scrolled-window) names &key policy) + (declare (ignore names)) + (when policy + (setf (slot-value window 'hscrollbar-policy) policy) + (setf (slot-value window 'vscrollbar-policy) policy)) + (call-next-method)) ;;; Statusbar @@ -1948,10 +1962,16 @@ (defun spin-button-value-as-int (spin-button) (round (spin-button-value spin-button))) -(defbinding spin-button-spin () nil +(defbinding %spin-button-spin () nil (spin-button spin-button) (direction spin-type) - (increment single-float)) + (increment double-float)) + +(defun spin-button-spin (spin-button value) + (etypecase value + (real (%spin-button-spin spin-button :spin-user-defined value)) + (spin-type (%spin-button-spin spin-button value 0)))) + (defbinding spin-button-update () nil (spin-button spin-button))