[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Pointing at a window.
- To: email@example.com
- Subject: Pointing at a window.
- From: Kevin Gallagher <Gallagher@gilgamesh.cs.umass.edu>
- Date: Fri, 27 Apr 90 13:27:01 EDT
- Cc: Gallagher@gilgamesh.cs.umass.edu
- Reply-to: Gallagher@gilgamesh.cs.umass.edu
- Sender: Gallagher@Gilgamesh@cambridge.apple.com
I'd like to be able to choose (not select) a window by pointing at it
with the mouse. I'm using _GetMouse to get the location of the mouse
click and _FindWindow to then determine which window (if any) is under
the mouse. However, no matter where I click _FindWindow returns 0
(meaning on the desktop) and WHICH-WINDOW is not a pointer to a window.
The _GetMouse call seems to work fine, because the point I get back is
Can anybody tell me what I'm doing wrong?
(defun point-at-a-window ()
(ccl:%stack-block ((where 4))
(ccl:%put-word where 0 0)
(ccl:%put-word where 0 2)
(do () ((ccl:mouse-down-p) t))
(ccl:_GetMouse :long where)
(ccl:rlet ((which-window :window))
(let ((result (ccl:_FindWindow :long where :ptr which-window :word)))
(print-db (ccl:point-string (ccl:%get-long where))
(ccl:rref which-window :window.windowkind)
Next question: Is there any way to click in an unselected window without
causing that window to become the selected window? I have an
application that displays stuff in several windows. The user can
interact with the displayed stuff using the mouse to point at things,
mark regions, etc. However, there's no reason to ever make the window
clicked on be the selected window. It just causes confusion.
This is a problem with my point-at-a-window function above. Clicking
on the window to choose it, also selects it.
Thanks for your help,