1 ;; -*- mode: Lisp; Syntax: Common-Lisp; Package: cells; -*-
4 Celtk -- Cells
, Tcl
, and Tk
6 Copyright
(C) 2006 by Kenneth Tilton
8 This library is free software
; you can redistribute it and/or
9 modify it under the terms of the Lisp Lesser GNU Public License
10 (http://opensource.franz.com
/preamble.html
), known as the LLGPL.
12 This library is distributed WITHOUT ANY WARRANTY
; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 See the Lisp Lesser GNU Public License for more details.
21 ;--- button ----------------------------------------------
23 (deftk button
(commander widget
)
26 -activebackground -activeforeground -anchor
27 -background -bitmap -borderwidth -cursor
28 -disabledforeground
(tkfont -font
) -foreground
29 -highlightbackground -highlightcolor -highlightthickness -image
31 -padx -pady -relief -repeatdelay
32 -repeatinterval -takefocus -text -textvariable
33 -underline -wraplength
34 -command -compound -default -height -overrelief -state -width
)
40 (defmacro mk-button-ex
((text command
) &rest initargs
)
41 `(make-instance 'button
44 :on-command
(c?
(lambda (self)
45 (declare (ignorable self
))
49 ; --- checkbutton ---------------------------------------------
51 (deftk radiocheck
(commander widget
)
54 -activebackground -activeforeground -anchor
55 -background -bitmap -borderwidth -compound -cursor
56 -disabledforeground
(tkfont -font
) -foreground
57 -highlightbackground -highlightcolor -highlightthickness -image
58 (tk-justify -justify
) -padx -pady -relief -takefocus -text -textvariable
59 -underline -wraplength
60 -command -height -indicatoron -offrelief
61 -overrelief -selectcolor -selectimage -state -tristateimage
62 -tristatevalue
(tk-variable -variable
) -width
))
65 (deftk checkbutton
(radiocheck)
72 :tk-variable
(c?
(^path
))
73 :on-command
(lambda (self)
74 (setf (^value
) (not (^value
))))))
76 (defobserver .value
((self checkbutton
))
77 (tk-format `(:variable
,self
) "set ~(~a~) ~a" (path self
) (if new-value
1 0)))
79 ; --- radiobutton -------------------------------------
81 (deftk radiobutton
(radiocheck)
87 :tk-variable
(c?
(path (upper self tk-selector
)))
88 :on-command
(lambda (self)
89 (setf (selection (upper self tk-selector
)) (value self
)))))
91 (defmacro mk-radiobutton-ex
((text value
) &rest initargs
)
92 `(make-instance 'radiobutton