[ltk-user] Handling radio-button values

Mirko Vukovic mirko.vukovic at gmail.com
Thu Oct 4 17:51:31 UTC 2007


Peter,

thank you very much for your help.  I am travelling now, and I will
try to use what you showed me when I get back home

Mirko

On 10/4/07, Peter Herth <herth at peter-herth.de> wrote:
> Hi Mirko,
>
> to access the value of a radio button set, you use the value function.
> It is of no importance, upon which button widget you call it as long
> as it is in the same set (means: those radio buttons which share the
> same variable). To illustrate I rewrote your example code:
>
> (defun radio-button-minimalist ()
>   (with-ltk()
>     (let* ((gender-frame (make-instance 'frame :master nil))
>            (lbl_gender (make-instance 'label
>                                       :master gender-frame
>                                       :text "Sex "))
>            (rdb_m (make-instance 'radio-button
>                                  :master gender-frame
>                                  :text "Male"
>                                  :variable "gender"
>                                  :value "Male"))
>            (rdb_f (make-instance 'radio-button
>                                  :master gender-frame
>                                  :text "Female"
>                                  :variable "gender"
>                                  :value "Female"))
>            (text (make-instance 'text
>                                :master nil
>                                :width 20
>                                :height 10))
>            (but (make-instance 'button
>                                :master nil
>                                :text "Push me"
>                                :command (lambda ()
>                                           (setf (text text)
>                                                 (format nil "The value
> of radio-button is: ~a" (value rdb_m))))
>                                ))
>            )
>       (setf *radio-button-minimalist* `(:text ,text))
>       (grid gender-frame 1 1)
>       (grid lbl_gender 1 1)
>       (grid rdb_m 1 2)
>       (grid rdb_f 1 3)
>       (grid but 2 1 :columnspan 2)
>       (grid text 3 1 :columnspan 2))))
>
>
> 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