From: cheetha (Ken Cheetham)

Subject: Re: [pcspr4288] Custom event handling of a widget

Date: 1997-1-8 19:02


> I expect that if you call call-next-method at the top of your EVENT > method rather than at the end then the OS will establish the new value
I have tried to do that. But it doesn't work. Any idea? An oversight of mine. I forgot that the OS implements the item-list widget to change its value on the mouse-button-up rather than the mouse-button-down. So you would need to check the value after the default button-up handler rather than after the button-down as I had suggested. After calling subclass-widget on a my-list widget, the following code will print its current value after any button-up. --------------------------------------------------------------------------- (defclass my-list (single-item-list)()) (defclass my-list-window (pc::single-item-list-pane)()) (defmethod widget-device ((dialog-item my-list) dialog) 'my-list-window) (defmethod event ((window my-list-window)(msg (eql mouse-left-up)) buttons data time) (call-next-method) ;; select the new value if there is one (let* ((widget (window-dialog-item window))) (when widget (print (dialog-item-value widget))))) ;; print current value --------------------------------------------------------------------------- Ken Cheetham <franz.com at cheetham> Franz Inc. Voice: (510) 548-3600 1995 University Avenue, Suite 275 Fax: (510) 548-8253 Berkeley, CA 94704 http: //www.franz.com/ ACL Windows FAQ: ftp.franz.com:/pub/acl4w-faq ACL Unix FAQ: ftp.franz.com:/pub/faq