X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?p=clnl;a=blobdiff_plain;f=src%2Fmain%2Fmodel.lisp;h=7ff6efb5b20152573d6bac0ffe6cfcd13999ff69;hp=f31b182e385e645913c95b015924eb4a62953c7c;hb=bc0c65622016066a82bc03b065f7138118c5b3cd;hpb=31a8f429b5182d9c4f3eae208ccc8efbdfe8a996 diff --git a/src/main/model.lisp b/src/main/model.lisp index f31b182..7ff6efb 100644 --- a/src/main/model.lisp +++ b/src/main/model.lisp @@ -75,7 +75,7 @@ DESCRIPTION: (make-model :code "" :interface (list - (make-view :min-pxcor -5 :max-pxcor 5 :min-pycor -5 :max-pycor 5 :patch-size 13d0)))) + (make-view :left 10 :top 10 :min-pxcor -5 :max-pxcor 5 :min-pycor -5 :max-pycor 5 :patch-size 13d0)))) (defun read-from-nlogo (str) "READ-FROM-NLOGO STR => MODEL @@ -381,6 +381,25 @@ DESCRIPTION: :display (button-display-name widget))))) (model-interface model)))) +(defun view (model) + "BUTTONS MODEL => VIEW-DEF + + VIEW-DEF: (:left LEFT :top TOP) + +ARGUMENTS AND VALUES: + + MODEL: A valid model + LEFT: An integer representing the left position + TOP: An integer representing the top position + +DESCRIPTION: + + Returns the view definition that get declared in the view of the + MODEL. This is used to initialize the interface." + (let + ((view (find-if #'view-p (model-interface model)))) + (list :left (view-left view) :top (view-top view)))) + (defun code (model) "CODE MODEL => CODE