#+cmu #:ext
#+sbcl #:sb-ext
#+clisp #:ext)
- #+clisp (:shadow #:map-dependents #:add-dependent #:remove-dependent)
- (:export #:start-atom-game))
+ #+clisp (:shadow #:map-dependents #:add-dependent #:remove-dependent))
(cl:in-package #:atoms)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun update-undo-redo-sensitivity (window)
(with-slots (actions game) window
- (setf (gtk:action-sensitive-p
- (gtk:action-group-get-action actions "undo"))
- (undo-list game)
- (gtk:action-sensitive-p
- (gtk:action-group-get-action actions "redo"))
- (redo-list game))))
+ (flet ((set-sensitive (act-name sensitivep)
+ (let ((act (gtk:action-group-get-action actions act-name)))
+ (setf (gtk:action-sensitive-p act) sensitivep))))
+ (set-sensitive "undo" (undo-list game))
+ (set-sensitive "redo" (redo-list game)))))
(defmethod notify progn
((window atom-game-window) (game atom-game) aspect &key)
(defvar *window* nil)
+(export 'start-atom-game)
(defun start-atom-game (&rest initargs)
(when *window*
(gtk:widget-destroy *window*)
(setf *window* (apply #'make-instance 'atom-game-window initargs))
(gtk:widget-show-all *window*))
-(start-atom-game :width 7 :players (list "Mark" "Vicky"))
+#+debug
+(start-atom-game :width 7
+ :players '("Alice" "Bob"))
;;;----- That's all, folks --------------------------------------------------