NSEvent Problem --- Can Not Get To Lowest Y Pixel of Screen
NSEvent Problem --- Can Not Get To Lowest Y Pixel of Screen
- Subject: NSEvent Problem --- Can Not Get To Lowest Y Pixel of Screen
- From: Henry McGilton <email@hidden>
- Date: Thu, 12 Jun 2003 19:37:27 -0700
What Ho,
I was informed of an 'off by one' problem in one of my
apps. After an entire day of hunting for this, I am
completely baffled. Here is the scenario.
I have a borderless transparent window that covers the screen.
Its content view watches mouse move events and also manages
mouse tracking when the app is not the active app, and it
manages cursor rects for a couple of other windows/views.
I have discovered that I can not get any of the mouse moved
events or (now) a mouse down event to show a y value of
0. The lowest y position I can move the mouse to on the
screen is reported as 1. Pixie reports that I am on pixel
y location 1023, which should correspond to pixel 0 on a
1024 pixel high screen.
I have checked the rectangles of the window and its content
view carefully to determine that both of them have their
origin at (0, 0).
I made the content view draw its rectangle so I could see
where it is located. The rectangle is drawing correctly
all the way down to the bottom of the screen.
But when I move the mouse as far as it can go on the screen,
the move events are reporting that y is at 1, and the mouse
down event reports the same. I use both [NSEvent mouseLocation]
and [theEvent locationInWindow] and they both report the same
locations (which is expected when the window origin is at the
screen origin.
There is a lot of machinery in this app, so I created a chopped
down version that has only a window and its content view, where
the content view watches mouse moved events and mouse down
events. The same problem is observed --- I can not obtain a
y location less than 1.
If anybody is interested in taking a look at the code, I have
placed a .sit archive of the project at
http://www.trilithon.com/download/products/macosx/BigScreen.sit
I assume that I am making some egregious mistake that is staring
me in the face, and that another pair of eyes will say immediately,
'you forgot the elephant lurking in the long grass' . . .
Best Wishes,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden |
http://www.trilithon.com
|
===============================+============================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.