X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/034ff0423c2a80734ae57491817fbce041e6a5d8..203681e230fc5783f54dabe79d765f4c4cec0351:/gtk/gtkaction.lisp diff --git a/gtk/gtkaction.lisp b/gtk/gtkaction.lisp index 9dff11c..7db1f2f 100644 --- a/gtk/gtkaction.lisp +++ b/gtk/gtkaction.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: gtkaction.lisp,v 1.8 2006-02-28 16:30:37 espen Exp $ +;; $Id: gtkaction.lisp,v 1.13 2008-04-11 18:34:02 espen Exp $ (in-package "GTK") @@ -32,9 +32,6 @@ (defmethod initialize-instance ((action action) &key callback) (when callback (apply #'signal-connect action 'activate (mklist callback)))) -(defmethod action-accelerator ((action action)) - (object-data action 'accelerator)) - (defbinding (action-is-sensitive-p "gtk_action_is_sensitive") () boolean (action action)) @@ -85,7 +82,7 @@ (defbinding action-group-remove-action () nil (defmethod initialize-instance ((action radio-action) &key group) (call-next-method) - (setf (slot-value action 'self) (sap-int (foreign-location action))) + (setf (slot-value action 'self) (pointer-address (foreign-location action))) (when group (add-to-radio-group action group))) @@ -93,7 +90,7 @@ (defbinding %radio-action-get-group () pointer (radio-action radio-action)) (defbinding %radio-action-set-group () nil - (radio-button radio-button) + (radio-action radio-action) (group pointer)) (defmethod add-to-radio-group ((action1 radio-action) (action2 radio-action)) @@ -118,7 +115,7 @@ (defun radio-action-get-current-value (action) ;;; Toggle Action -(defmethod initialize-instance ((action toggle-action) &rest initargs &key callback) +(defmethod initialize-instance ((action toggle-action) &rest initargs &key callback #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")active) (remf initargs :callback) (apply #'call-next-method action initargs) (when callback @@ -130,7 +127,8 @@ (defmethod initialize-instance ((action toggle-action) &rest initargs &key callb #'(lambda () (funcall function (toggle-action-active-p action)))) :object object :after after))) - (when (toggle-action-active-p action) + #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0") + (when active (action-activate action))) (defbinding toggle-action-toggled () nil @@ -210,9 +208,9 @@ (defbinding %ui-manager-add-ui () nil (defvar *valid-ui-elements* '((:ui :menubar :toolbar :popup :accelerator) (:menubar :menuitem :separator :placeholder :menu) - (:menu :menuitem :separator :placehoder :menu) - (:popup :menuitem :separator :placehoder :menu) - (:toolbar :toolitem :separator :placehoder) + (:menu :menuitem :separator :placeholder :menu) + (:popup :menuitem :separator :placeholder :menu) + (:toolbar :toolitem :separator :placeholder) (:placeholder :menuitem :toolitem :separator :placeholder :menu) (:menuitem) (:toolitem)