(list :switch (append switch-def (list :height clnl-gltk:*switch-height*)) switch nil)))
switch-defs))
-(defun initialize (&key dims view buttons switches)
+(defun textbox-defs->textboxes (textbox-defs)
+ (mapcar
+ (lambda (textbox-def)
+ (let*
+ ; we adjust to make it match jvm netlogo more accurately because
+ ; of what we do with width/height (in terms of characters)
+ ((adjusted-top (+ (getf textbox-def :top) 3))
+ (adjusted-left (- (getf textbox-def :left) 3))
+ (textbox
+ (clnl-gltk:textbox
+ adjusted-left
+ (- *window-height* (* (getf textbox-def :height) clnl-gltk:*font-height*) adjusted-top)
+ (getf textbox-def :width)
+ (getf textbox-def :height)
+ :text (getf textbox-def :display)
+ :border nil
+ :word-wrap t)))
+ (list
+ :textbox
+ (append
+ (list
+ :left adjusted-left
+ :top adjusted-top
+ :height (* (getf textbox-def :height) clnl-gltk:*font-height*))
+ textbox-def)
+ textbox nil)))
+ textbox-defs))
+
+(defun initialize (&key dims view buttons switches textboxes)
"INITIALIZE &key DIMS VIEW BUTTONS SWITCHES => RESULT
DIMS: (:xmin XMIN :xmax XMAX :ymin YMIN :ymax YMAX :patch-size PATCH-SIZE)
(setf *widgets*
(append
(button-defs->buttons buttons)
+ (textbox-defs->textboxes textboxes)
(switch-defs->switches switches))))
(defun run ()
(clnl-gltk:textbox
5 (+ clnl-gltk:*font-height* 14)
10 12
- (format nil *initial-banner* (asdf:component-version (asdf:find-system :clnl)))))
+ :text (format nil *initial-banner* (asdf:component-version (asdf:find-system :clnl)))))
(setf *inputbox* (clnl-gltk:inputbox 5 5 10))
(cl-glut:main-loop)))