[Openmcl-devel] Can anyone get mouse up events in the Windows/Cocotron version of ccl?

Michael Minerva minerva at agentsheets.com
Fri Sep 3 12:05:39 PDT 2010

Apparently Christophe Llloyd from cocotron had already fixed this bug locally and he just committed this fix 20 minutes ago.  If you guys upgrade the Cocotron library to the newest version in the Mercurial repository this problem should be fixed.  

On Sep 2, 2010, at 6:58 PM, Gary Byers wrote:

> I was going to say that I couldn't reproduce it, but I realized that the Cocotron libraries that I was using were a little old.  I updated
> my ccl/cocotron directory, rebuilt the IDE, tried your test, and got
> the same results that you reported (nothing printed on mouseup.)  That
> strongly suggests that there was a change in the Cocotron libraries between
> whatever (possibly several months old) version I had installed on that
> machine and the versions that we're distributing now.
> I can't think of anything in CCL that'd affect this (and certainly can't
> think of anything that'd do so intentionally.)
> If you still have the application bundle built by XCode, you might try
> replacing the AppKit and Foundation .dlls in that bundle with the ones
> from ccl/cocotron.  If the ObjC application behaves the same way, then
> we can definitely say that CCL isn't involved.
> I don't know whether it'd be necessary to upgrade the Cocotron
> libraries that we distribute or downgrade them in order to avoid the
> problem; Gary Palter may have a better idea of that.
> On Thu, 2 Sep 2010, Michael Minerva wrote:
>> I have been unable to get mouse up events on the windows version of the ide, and I was wondering if anyone has found a workaround for this?  It seems that this is not a cocotron issue because I made a cocotron project that receives both mouse up and mouse down events with no problem using objective c.  The following code illustrates the problem pretty well.  In OSX the  code will display a window and when you click you get both mouse up and mouse down events (as well as drags if you drag), but on the windows/cocotron ide you only get the mouse down and drag events.  Has anyone else experienced this?  Anyone know what is going on here?
>> (defclass MOUSE-EVENT-WINDOW (ns:ns-window)
>> ((lui-window :accessor lui-window :initarg :lui-window))
>> (:metaclass ns:+ns-object))
>> (objc:defmethod (#/mouseUp: :void) ((Self mouse-event-window) Event)
>> (call-next-method event)
>> (print "mouseup!"))
>> (objc:defmethod (#/mouseDown: :void) ((Self mouse-event-window) Event)
>> (call-next-method event)
>> (print "mousedown!"))
>> (objc:defmethod (#/mouseDragged: :void) ((Self mouse-event-window) Event)
>> (call-next-method event)
>> (print "mouse dragged!"))
>> (defmacro IN-MAIN-THREAD (() &body body)
>> (let ((thunk (gensym))
>>       (done (gensym))
>>       (result (gensym)))
>>   `(let ((,done nil)
>>          (,result nil))
>>      (flet ((,thunk ()
>>               (setq ,result (multiple-value-list (progn , at body))
>>                     ,done t)))
>>        (gui::execute-in-gui #',thunk)
>>        (process-wait "Main thread" #'(lambda () ,done))
>>        (values-list ,result)))))
>> (defun up-event-test ()
>> (ns:with-ns-rect (Frame 50 50 500 500)
>> (let ((window (make-instance 'mouse-event-window
>>                                ;:lui-window self
>>                 :with-content-rect Frame
>>                 :style-mask #$NSTitledWindowMask
>>                 :backing #$NSBackingStoreBuffered
>>                 :defer #$YES
>>                 )))
>>   (in-main-thread ()
>>   (#/orderFront: window nil)))))
>> (up-event-test)
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> http://clozure.com/mailman/listinfo/openmcl-devel

More information about the Openmcl-devel mailing list