cvs import
[celtk.git] / label.lisp
blob9492d14f7f9f8cc4089e40692cab9a002955ecdc
1 ;; -*- mode: Lisp; Syntax: Common-Lisp; Package: cells; -*-
2 #|
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.
19 (in-package :Celtk)
21 (deftk label (widget)
23 (:tk-spec label
24 -activebackground -activeforeground -anchor
25 -background -bitmap -borderwidth -compound -cursor
26 -disabledforeground (tkfont -font) -foreground
27 -highlightbackground -highlightcolor -highlightthickness -image
28 (tk-justify -justify)
29 -padx -pady -relief -takefocus -text -textvariable -underline
30 -height -state -width -wraplength)
31 (:default-initargs
32 :id (gentemp "LBL")))
34 ;;; --- images -------------------------------------------------------
36 (defobserver image-files ()
37 (loop for (name file-pathname) in (set-difference new-value old-value :key 'car)
38 do (tk-format `(:pre-make-tk ,self)
39 "image create photo ~(~a.~a~) -file {~a} -height ~a -width ~a"
40 (^path) name (namestring file-pathname)
41 (^height)(^width))))
43 ;--------------------------------------------------------------------------
45 (deftk message (widget)
47 (:tk-spec message
48 -activebackground -activeforeground -anchor
49 -background -bitmap -borderwidth -compound -cursor
50 -disabledforeground (tkfont -font) -foreground
51 -highlightbackground -highlightcolor -highlightthickness -image
52 (tk-justify -justify)
53 -padx -pady -relief
54 -takefocus -text -textvariable
55 -underline -wraplength -width -state -height)
56 (:default-initargs
57 :id (gentemp "MSG")))