[ltk-user] The cutting edge at http://ltk.rplay.net/svn/branches/ltk/repl/

Jussi Salmela mimmottos at gmail.com
Sun Jul 26 07:12:16 UTC 2009

My environment: Windows Vista, Tcl/Tk and Clozure Common Lisp
Version 1.3-r11936  (WindowsX8632).

I took a look at the forthcoming version of LTK at the address above. I
understand that this is work-in-progress
and that some of my observations may be the result of how Windows or Tk
behaves so that nothing can be done.
I also know almost nothing of Tk, very little of LTK and Lisp are a bit
rusty, so bear with me...

1. tktable.lisp

When I did (compile-file "tktable") I got the following warning:
     ;   In an anonymous lambda form at position 2382: Initarg :ROWS occurs
in both ROWS and COLS slots
I guess this is a valid error message and the code should be corrected like
this (the original row is commented out):
(defclass scrolled-table (frame)
  ((table :accessor table)
   (hscroll :accessor hscroll)
   (vscroll :accessor vscroll)
   (rows :accessor rows :initarg :rows :initform nil)
   ;(cols :accessor cols :initarg :rows :initform nil)
   (cols :accessor cols :initarg :cols :initform nil)
   (titlerows :accessor titlerows :initarg :titlerows :initform nil)
   (titlecols :accessor titlecols :initarg :titlecols :initform nil)
   (data :accessor data :initarg :data :initform nil)

When I run (tabletest) I get a neat-looking table with 200 rows and 40
columns. The cells have light-gray (?) background
and the foreground color is black (?). Very clear, no strain to the eye.

But when I click a cell with the mouse, the background first changes to
blue(?) then changes back to
the original light-gray (?) and the foreground color changes to white (?).
This combination
of colors makes it very hard to see what the cell contents are.

Scrolling by dragging the thumbs OK. Vertical scroll with either PgDn-key or
by clicking the vertical scroll area below
the thumb brings new rows into view but leaves one row out. The reason (as
an example) is this: when the table is
at first displayed it shows the first 34 rows in whole and a tiny slice of
the 35th row also. The system "thinks" that
the row 35 was shown although it was not wholly visible and starts showing
the next rows from the 36th row onward.

If I squeeze the tiny slice out by diminishing the window height a little
the vertical scroll starts to function correctly. It would
be nice if Ltk or Tk could squeeze the slice out instead.

Still on the vertical scroll: If in the starting view (i.e. the rows 1-34
showing) I click the cell of (row 9, col 5), for instance,
to get it focused and then do a vertical scroll of one pagefull and scroll
back (PgDn and PgUp, for instance), the focus
(i.e. the text caret) is in the cell (row 1, col 1) and the cell (row 9, col
5) is displayed with a blue background.

2. ltk.lisp

THE TEST i.e. (ltktest) OK as far as I understand. The Tk styles for Windows
(winnative, xpnative) work beautifully.
As the program starts the default selection of the radio button is on and
the theme is xpnative as it should be on Vista.
If, however, I choose another theme and then select the default again, the
theme is not xpnative but Motif I think.

EDIT: It later occurred to me that maybe "default" here means "Tk default"
and not "Windows XP/Vista default" but still
the behavior is not consistent.

(ltkeyes) OK. All other tests except defwidget-test work. Running
(defwidget-test) gives the error msg
"Class named TW not found.".

3. ltk-tile.lisp

Running (tile-test) gives several times the error 'Tcl/Tk error: invalid
command name "style" '. After adding
"ttk::" to the beginning of "style" like this:

(defun theme-names ()
  (send-wish "senddatastrings [ttk::style theme names]")

(defun use-theme(name)
  (format-wish "ttk::style theme use ~a" name))

the program runs OK except that it has the same problem with the default
theme as ltktest above.

4. ltk-mw.lisp

Compiling gives:
     ((SETF DATA) :AFTER (T LIST-SELECT)): Unused lexical variable VAL

Apparently it concerns the last method in the list-select box widget:

(defmethod (setf data) :after (val (select list-select))
  (listbox-clear select)
  (listbox-append select (mapcar (lambda (item)
                                   (list-select-display select item))
                                 (data select))))

The test (tooltip-test) functions, sort-of. The tooltip is shown but at the
screen position (0,0)!
While debugging by spreading prints around I by accident discovered a silly
way of correcting
the behavior. This is how the last lines of the tooltip method show look
like now when it
is operating correctly:
   (when (and txt (> (length txt) 0))
      (setf (text (tooltip-label tooltip)) txt)
      ;(print (geometry tooltip ))
      (set-geometry-xy tooltip (truncate x)  (truncate y))
      ;(print (geometry tooltip ))
      (geometry tooltip )
      (normalize tooltip)
      ;(print (geometry tooltip ))
      (raise tooltip))))

So the extra call to geometry does the trick and naturally I have no idea
what is going on here.

Running (gtree-demo) produces errors about :borderwidth and height in:
     (defmethod gtree-render-node ((d gtree-demo) node )
         (make-instance 'label :master d :text node :borderwidth 3 :relief
:raised :background :grey :height 1 :width 10))
After the removal of these the run succeeds.

Rest of the demos OK.

Jussi Salmela
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ltk-user/attachments/20090726/521994c3/attachment.html>

More information about the ltk-user mailing list