Hi,
New to LTK, I just want to change the button height, but couldn’t. Doing it in (make-instance …), I got “Invalid initialization argument: :HEIGHT in call for class #<STANDARD-CLASS BUTTON>” error. Doing it in (configure b :height 10), then I got “Tcl/Tk error: unknown option “-height””. What’s the proper way to do it?
Sample code: (defun display-image-button (filename) (with-ltk () (format-wish "package require Img") (let* ((img (make-image)) (b (make-instance 'button :text "Hello World!" :image img :width 10 :command (lambda () (do-msg "Bye! "Hello World!"") (setf *exit-mainloop* t))))) ;; Pack the canvas (pack b) ;(scrollregion c 0 0 800 800) ;; Load the image from the file (image-load img filename) ;; Draw the image on the canvas ;(create-image c 0 0 :image img) (configure b :height 10) )) )
thanks, David
On Sat, Sep 12, 2015 at 10:51:45PM -0700, David Wong wrote:
Hi,
New to LTK, I just want to change the button height, but couldn’t. Doing it in (make-instance …), I got “Invalid initialization argument: :HEIGHT in call for class #<STANDARD-CLASS BUTTON>” error. Doing it in (configure b :height 10), then I got “Tcl/Tk error: unknown option “-height””. What’s the proper way to do it?
Hello!
I guess LTK use ttk as default, see:
according to documentation there is no "height" option for the ttk::button
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_button.htm
IIRC if the image initarg is used the button automatically will shrink/inflate to accomodate the image.
Bye! C.
Thank you cage! I'll learn about ttk.
Thanks David
On Sep 13, 2015, at 1:41 AM, cage cage@katamail.com wrote:
On Sat, Sep 12, 2015 at 10:51:45PM -0700, David Wong wrote: Hi,
New to LTK, I just want to change the button height, but couldn’t. Doing it in (make-instance …), I got “Invalid initialization argument: :HEIGHT in call for class #<STANDARD-CLASS BUTTON>” error. Doing it in (configure b :height 10), then I got “Tcl/Tk error: unknown option “-height””. What’s the proper way to do it?
Hello!
I guess LTK use ttk as default, see:
according to documentation there is no "height" option for the ttk::button
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_button.htm
IIRC if the image initarg is used the button automatically will shrink/inflate to accomodate the image.
Bye! C.