How to change the title of the root window?

Volker vos at lundinova.se
Thu Jun 21 07:59:26 UTC 2018


I'm trying to get started with ltk and of cause running into many
problems. One is: how do I change the title of the root window (it is
"LTK" as default).

The corresponding python code would be:

root = Tk()
root.title("Hello, world")


This was one of my many unsuccessful tries:

(defun how-to-set-title ()
   (ltk:with-ltk ()
     (let* ((root (make-instance 'ltk:widget :name "." :path "."))
            (b (make-instance 'button
                              :master nil
                              :text "Press Me"
                              :command (lambda ()
                                         (format t "Hello World!~&")))))
       (setf (title root) "My app")
       (pack b))))

I experienced a bit with toplevel (where I could set the name of the
window) but this always opened an additional new window.

Any help appreciated!

Regards
Volker




More information about the ltk-user mailing list