Can anyone help me with this Objective-C?

Miscellaneous Forums/MacOS X Discussion/Can anyone help me with this Objective-C?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Instead of using those temporary ints, just dereference x and y directly in NSMakePoint, so NSMakePoint(*x,*y) should work fine.

I guess I'm not really sure what you're trying to achieve. The Cocoa coordinate system starts from the bottom left, so the numbers may not be what you expect.

From what I can tell from your code, the relativeTo function will return the x and y position relative to the whole screen. The absoluteFrom will return a value telling you how the x and y screen coordinates you give are relative to the view. The mouse event values you provide therefore are going to look odd, number one because they start in the top-left, and number two because they are window relative.

Instead of getting mousex and y, try setting a specific screen coordinate (ie. 10,10=bottom left corner) and then using your function, move the window around relative to that and you'll get how it works.