From: Bruce Tobin

Subject: Re: Custom event handling of a widget

Date: 1996-12-26 22:30



On Thu, 26 Dec 1996, Wai-Kwong Sam LEE wrote:

> Hello, > > Does anyone know how to define the keyboard/mouse behavior of a widget, > say, single-item-list? What I want to do is to add functions for mouse > left single click, left double click and right single click. >
Well, I can give you another plausible approach that doesn't work: (defclass my-single-item-list (single-item-list) ()) (defclass my-single-item-list-pane (pc::single-item-list-pane) ()) (defmethod widget-device ((widget my-single-item-list)(dialog basic-pane)) 'my-single-item-list-pane) (defmethod event ((window my-single-item-list-pane) (event (eql mouse-left-double-click)) shift data time) (print "Left button double clicked.")) I think I know why your code doesn't work (I don't think method events are ever called on dialog items directly), but I don't have a clue as to why this code doesn't.