[ltk-user] update?

Peter Herth herth at peter-herth.de
Thu Oct 4 14:04:33 UTC 2007

Hello Zdenek,

On 10/1/07, Zdenek Eichler <zdenek.eichler at gcajkol.cz> wrote:
> Hello,
> i made some updates, may be useful.
> i updated this function:
> (defun read-event (&key (blocking t) (no-event-value nil))
>    (or (pop (wish-event-queue *wish*))
>        (if (or blocking (can-read (wish-stream *wish*)))
>            (if (eql #\( (peek-char t (wish-stream *wish*) nil))
>               (read-preserving-whitespace (wish-stream *wish*) nil nil)
>               (read-line (wish-stream *wish*) nil))
>           no-event-value)))
> Original function was not working under intel mac. Concretely made
> error when you click on menubutton when mouse is moving. This error
> is because of different version of tcl/tk aqua on intel and powerpc.

Could you please describe, in which setup the bug appeared (which Lisp
etc.), what exactly the bug was and how your changes fixed it?

> And added same functions:
> This function allow to change menubutton state between normal, hidden
> and disabled.
> (defgeneric state (menu menu-label state))
> (defmethod state ((a menu) menu-label state)
>    (format-wish "~a entryconfigure {~a} -state {~a}" (widget-path a)
> menu-label state))
> This function allow to change label of menubutton. Important in Apple
> HIG.
> (defgeneric menu-label (menu old new))
> (defmethod menu-label ((a menu) old new)
>    (format-wish "~a entryconfigure {~a} -label {~a}"  (widget-path
> a)  old new))
> Allow to eneble or disable resizing window.
> (defgeneric resizable (widget x y))
> (defmethod resizable ((tl widget) x y)
>    (format-wish "wm resizable ~a ~a ~a" (widget-path tl) x y)
>    tl)

I added those functions.

> Clear scrolled-listbox.
> (defmethod listbox-clear ((l scrolled-listbox))
>    (listbox-clear (listbox l))
>    l)

There is a fundamental problem with all the scrolled-* widgets. They
wrap around a base widget but either we define all methods on the
wrapped widget as delegates in the scrolled-* widget - or which I
prefer, let the user just access the wrapped widget and call methods
on those.

Thanks for your additions,


More information about the ltk-user mailing list