Windows issues parsing these characters. Bug fix for entering edit mode without setti...
[cowl.git] / examples / 03-basic-layout.lisp
blobf2e9b3dbe605488b99f9f71e28510b0ddc8614aa
1 (require '#:asdf)
2 (asdf:oos 'asdf:load-op '#:cowl-glfw)
4 (defun main ()
5 (glfw:do-window (:title "Cowl Basic Layout" :width 400 :height 300)
6 ((setf cowl:*root-widget*
7 ;; this is basically a wrapper around the generic cowl:container
8 (cowl:make-vbox (:width 400 :height 300
9 :row-heights '((:weight . 1.0)
10 (:expand . 10)
11 (:expand . 10)
12 (:weight . 1.0)))
14 ;; the body of this macro is a list of widgets for the wrapper
16 nil ;; nil in weighted spaces will expand as necessary
18 (cowl:make-label "Hello, basic layout.")
20 (cowl:make-hbox (:width 400)
21 (cowl:make-button () "One"
22 (format t "Button One clicked!~%"))
23 (cowl:make-button () "Two"
24 (format t "Button Two clicked!~%"))
25 (cowl:make-button () "Three"
26 (format t "Button Three clicked!~%"))
27 (cowl:make-button () "Four"
28 (format t "Button Four clicked!~%")))
31 (cowl:make-button () "Click to exit!"
32 ;; The body of this macro is executed on left-click.
33 (return-from main))
35 nil))
37 (cowl-glfw:setup-input-callbacks))
39 ;; Main loop the same as before
40 (gl:clear gl:+color-buffer-bit+)
41 (cowl:layout-root)
42 (cowl:draw-root)
43 (sleep 0.04)))
45 (main)