[ltk-user] ltk examples

Bernhard Graf bgraf at adartis.de
Thu Nov 23 12:38:21 UTC 2006


I made it !!! :-)

(defun scaler ()
   (with-ltk ()
     (let* ((frm (make-instance 'frame))
	   (lab (make-instance 'label :master frm :text "Enter Name: "))
	   (ent (make-instance 'entry :master frm))
	   (age 0)
	   (textarea (make-instance 'frame))
	   (txt (make-instance 'scrolled-text :master textarea))
	   (scl (make-instance 'scale :label "Age:" :digits 1 :from 10 :to  
50 :tickinterval 10))
	   (but (make-instance 'button :master textarea :text "Push Me"
                                :command (lambda () (append-text txt  
(concatenate 'string "Hello, "  (text ent ) (format nil ", you are ~D  
years old" (value scl))
								)))))
	   )
	   (pack lab :side :left)
	   (pack ent :side :left)
	   (pack frm)
	   (pack scl)
	   (pack but)
	   (pack txt)
	   (pack textarea)
)))

Actually, while programming this seemingly simple example, I  
recognized that LISP has 1001 arithmetic functions, but when it comes  
to string-to-number-and-back conversion, it looks pretty bad.

Is that so or am I just only looking at the wrong places ?
I found a parse-number library from Matthew Danish and use format to  
convert from numbers back to strings, but the latter seems rather  
ugly compared to actual "functions" that I know from Turbo Pascal and  
the former is quite good, but still not completely universal.

Greetings,
Bernhard

Am 23.11.2006 um 13:04 schrieb Peter Herth:

> Or just (value myscale) if myscale is the scale widget....
>
> Peter
> _______________________________________________
> ltk-user site list
> ltk-user at common-lisp.net
> http://common-lisp.net/mailman/listinfo/ltk-user





More information about the ltk-user mailing list