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
On 06/21/18 09:59, Volker wrote:
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))))
Ok, found it! This works:
(defun how-to-set-title-1 () (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!~&"))))) (ltk:wm-title root "My App") (pack b))))
Volker
This is probably the correct solution:
(ltk:wm-title *tk* "My App")
/Volker