-
Notifications
You must be signed in to change notification settings - Fork 7
/
management.lisp
45 lines (37 loc) · 1.27 KB
/
management.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload "iup"))
(defpackage #:iup-examples.management
(:use #:common-lisp)
(:shadow #:management)
(:export #:management))
(in-package #:iup-examples.management)
(defvar *counter* 1)
(defun button-callback (handle)
(let* ((dialog (iup:get-dialog handle))
(dialog-child (iup:get-child dialog 0)))
(iup:destroy dialog-child)
(let ((new-dialog-child (make-widget)))
(iup:append dialog new-dialog-child)
(iup:map new-dialog-child)
(iup:refresh dialog))
iup:+default+))
(defun make-widget ()
(let* ((label (iup:label :title (format nil "Current counter ~A" *counter*)))
(text (iup:text :value "here an example"
:expand :horizontal))
(button (iup:button :title "Replace!"
:action 'button-callback
:expand :horizontal))
(vbox (iup:vbox (list label text button))))
(incf *counter*)
vbox))
(defun management ()
(iup:with-iup ()
(let* ((dialog (iup:dialog (make-widget) :title "Hierarchy Management Example")))
(iup:show dialog)
(iup:main-loop))))
#-sbcl (management)
#+sbcl
(sb-int:with-float-traps-masked
(:divide-by-zero :invalid)
(management))