[ltk-user] update?

Zdenek Eichler zdenek.eichler at gcajkol.cz
Mon Oct 1 12:23:31 UTC 2007


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.

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)

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

Zdenek Eicher





More information about the ltk-user mailing list