I'm using LTK for basic windows in Common Lisp. I want to create a square button, but it turns out that height can't be changed. Here's the relevant part of the code:
(let ((tile (make-instance 'button
:width 20
:height 20))))
I'm getting an error:
Invalid initialization argument:
:HEIGHT
in call for class #<STANDARD-CLASS LTK:BUTTON>.
See also:
The ANSI Standard, Section 7.1.2
[Condition of type INITARG-ERROR]
In the LTK documentation, height is listed as configurable for buttons. Is there something wrong with the installation or is it a known bug or what?
I think it is missing on ltk side. With
M-.
in Slime I go to the definition of button:There is no
height
indeed and it doesn't come fromwidget
.I asked on nodgui (ltk fork with syntax sugar and more meta-widgets) because the maintainer is real nice: https://notabug.org/cage/nodgui/issues/6
His answer:
nodgui supports only the widget that use 'ttk' theme engine:
https://www.tcl.tk/man/tcl8.6/TkCmd/ttk_intro.htm
the documentation for ttk::button:
https://www.tcl.tk/man/tcl8.6/TkCmd/ttk_button.htm
shows no height parameter (correct me if I am wrong)
(is there a chance that you are looking at https://www.tcl.tk/man/tcl8.6/TkCmd/button.htm ? This is the non-ttk version of the widget and is not supported)
Probably you can play with frame and sticky attribute to modify the geometry of a button (never tried), moreover I do not know about a way to specify the size of a button in pixel units.
Hope this helps someway! :)
ps: Probably is important to point out that the LTK documentation is outdated in the widget part.
Other information to consider: https://mailman.common-lisp.net/pipermail/ltk-user/2016-June/000625.html
Configuring is done through the
configure
function according to ch. 3.14 of the documentation.