[cells-devel] Cello: 'find-view-under: Semantics ?
Frank Goenninger
frgo at me.com
Fri Jul 24 16:28:44 UTC 2009
Am 24.07.2009 um 17:48 schrieb Kenneth Tilton:
> Frank Goenninger wrote:
>> Hi again -
>> thanks again for the fast response on my last request - hoping for
>> another fast one here ;-)
>> So, Cello (the original one) has this function:
>> (defun find-ix-under (self os-pos &key (test #'true))
>> (when (and (not (typep self 'tool-tip)) ;; <g>
>> (visible self)
>> (not (collapsed self)))
>> (trc nil "find-ix-under" self os-pos (screen-box self))
>> (let ((inself (point-in-box os-pos (screen-box self))))
>> (or (when (or inself (not (clipped self)))
>> (trc nil "inside self sbox" self os-pos (screen-box
>> self))
>> (dolistreversed (k (or (render-order self)(kids
>> self))) ;; overlap goes to last kid displayed
>> (unless (typep k 'window)
>> (trc nil "fixunder kid!!!!!!!!" k)
>> (bwhen (ix (find-ix-under k os-pos :test test))
>> (return-from find-ix-under ix)))))
>> (when (and inself
>> (funcall test self)
>> (not (ix-click-transparent self)))
>> (trc nil self os-pos (screen-box self))
>> self)))))
>> which is used as follows:
>> (defmd mouse-view-tracker ()
>> (mouse-view :initarg :mouse-view :accessor mouse-view
>> :initform (c? (let ((pos (mouse-pos .og.)))
>> (trc nil "mouseview sees pos" .w. pos)
>> (when pos
>> (eko (nil "ix-togl mouseview >" self)
>> (without-c-dependency
>> (find-ix-under self pos)))))))
>> (:documentation "Mixin to have mouse view tracked in a subtree
>> of the window, mostly so other GUI layout can depend on
>> the sub-tree layout without creating a cyclic dependency, as would
>> happen iof the whole window were watched."))
>> (defmd ix-togl (mouse-view-tracker #+not focuser ogl-lit-scene
>> control ogl-shared-resource-tender togl ix-view)
>> ...
>> So, the togl widget is a sub-class of mouse-view-tracker. I
>> understand this as "show me the control that is currently being
>> pointed at by the mouse".
>> Only thing is: When looking at the code for 'find-ix-under I can't
>> see how this could possibly work? May I ask for a walk-through of
>> find-ix- under ?
>
> haha, no!
;-) Hehe - as if I hadn't expected to get a "Joe, you can do this
yourself" answer... but:
> Please walk me thru what you do not understand.
I actually am still struggling with things like g-box, g-offset, and
stuff. That's where my problem lies, really, or so it seems...
> The disabled debug statements give you some hints: first I
> recursively check kids, if that comes up empty I check myself to see
> if I am under the mouse and want to be the result.
Well, that's just clear - it does work in original Cello. But it
doesn't in my Remake... Sh*t.
>
> hth, kt
>
> ps. Yes, it works. :) k
I know. I can see it when running original Cello here. Hmpf !
I could help to have a real good IDE with stepping support - which I
don't have. I miss it rarely, but currently I do !!! AllegroCL sucks
in this respect on Mac OS X...
Cheers
Frank
--
Frank Goenninger
Cell: +49 175 4321058
E-Mail: frgo at me.com
More information about the cells-devel
mailing list