mikelevins / xmlisp

Automatically exported from code.google.com/p/xmlisp
0 stars 0 forks source link

#/mouseEventWithType:location.... method does not work with cocotron ccl but seems to be implemented by cocotron #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The full method name is: 
#/mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:event
Number:
clickCount:pressure:
this method is used to create an a mouse click event but it seems to not work 
cocotron ccl even 
though it seems that it is implemented here: 

http://code.google.com/p/cocotron/source/browse/trunk/AppKit/NSEvent.subproj/NSE
vent.m

Here are a couple of methods that will help you reproduce the problem all the 
code executes but 
when the button is pressed it works fine on mac ccl but on windows it reports 
that the 
mouseEventWithType method is undefined:

;this function when called will just make a dummy event, please not that this 
will have to be 
;in the LUI package because it uses native-view
(export '(make-event))
(defun make-event (window) 
  (ns:with-ns-rect (Frame 100 50 200 200)
    (ns:with-ns-point (Point 50 50)
      (let ((context (#/graphicsContextWithWindow: ns:ns-graphics-context (native-window 
window))))
        (let ((event 
(#/mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:even
tNumber:
clickCount:pressure:
                      ns:ns-event
                      #$NSLeftMouseDown
                      Point
                      0
                      55555555545464564646.0d0
                      1
                      context
                      1
                      1
                      1.0))))))))

;This code will just display a button that when pressed will call the 
make-event method
(defmethod hello ((w application-window) (Button button))
  (make-event w))

<application-window title="Currency Converter" width="300" height="180">
  <column align="stretch" valign="stretch" padding="9">
    <row align="stretch" minimize="vertical" valign="bottom">
      <button text="make-event" action="hello" width="100" default-button="true"/>
    </row>
  </column>
</application-window>

Original issue reported on code.google.com by pokermik...@gmail.com on 18 Dec 2009 at 7:31

GoogleCodeExporter commented 9 years ago
The Cocotron project implemented this method in Cocotron r708.  I've updated 
the CCL Cocotron and FFI 
bindings to include that fix in CCL r13350.  You'll need to update both your 
ccl/ and ccl/cocotron/ directories to 
get this.  (Remember that "svn up" on ccl/ won't updated ccl/cocotron/; you 
must update that explicitly.)

Original comment by palter@clozure.com on 31 Dec 2009 at 8:41