[mcclim-devel] How stream-pointer-position should work?

Evgeny M. Zubok evgeny.zubok at tochka.ru
Sun Dec 27 01:14:26 UTC 2009

"Evgeny M. Zubok" <evgeny.zubok at tochka.ru> writes:

> So, what is the right behavior of stream-pointer-position if the
> stream has a scroller?  Shouldn't it return the real coordinates on
> stream as pointer events do?

I found an answer to my question. I have just found CLIM implementation
from Allegro CL (I only used it with lesstif backend instead motif). 

To test I create a pane 'canvas' with :min-height 2000 :min-width 2000
and layout (scrolling (:height 500 :width 500) ...). In
define-presentation-action for blank-area I call stream-pointer-position
and print string "TEST", starting that point . In Allegro's CLIM
implementation the strings appear where I have pressed pointer button;
in McCLIM they appear only at the first page of canvas, even if I have
pressed button on blank-area on other pages. So, I think, this is bug in

Sample code:

(defpackage :stream-pointer-position-bug
  (:use :clim-lisp :clim))

(in-package :stream-pointer-position-bug)

(defun run ()
  (run-frame-top-level (make-application-frame 'main)))

(define-application-frame main ()
  (:menu-bar nil)
   (canvas (scrolling (:height 500 :width 500) 
	     (make-pane 'application-pane
			:display-time nil 
			:background +black+ :foreground +white+
			:min-width 2000 :min-height 2000
			:scroll-bars t
			:display-function #'draw-circle
			:name 'canvas
			:output-record (make-instance 
    (:main canvas)))

(defun draw-circle (frame pane)
  (declare (ignore frame))
  (draw-circle* pane 1500 1500 70 :filled t :ink +yellow+))

(define-presentation-action test
    (blank-area nil main :gesture :select)
    (presentation window)
  (declare (ignore presentation))
  (multiple-value-bind (x y)
      (stream-pointer-position window)
    (draw-text* window "TEST" x y)))

More information about the mcclim-devel mailing list