Search code examples
common-lispltk

Acessing values of ltk widget options


I am trying to make a GUI application in common lisp with ltk, and there is one thing I just cannot figure out. I know I can set options of ltk widgets with configure, but I cannot figure out a way to read the values.

For example, I create an instance of a canvas with

(make-instance 'canvas :width 400 :height 400)

Then I want to write a method that will use the width and height in some calculations. How do I access these?


Solution

  • I've asked this same question in the ltk user list and got an answer.

    In short, the cget function is the counterpart of configure

    So, to set the canvas width you do (configure canvas :witdh value) and to retrieve it you do (cget canvas :width).

    Regards,

    André