Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kbaum

macrumors newbie
Original poster
Sep 7, 2007
9
0
Hi, how do I store the x value of an NSPoint into a float? Thanks.

Also, how do I make my application stay the frontmost app (without it being fullscreen)?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
See the NSPoint documentation. It's just a struct. If you don't know what a struct is, you should go back and learn C.
 

Nutter

macrumors 6502
Mar 31, 2005
432
0
London, England
Also, how do I make my application stay the frontmost app (without it being fullscreen)?

This can be done by creating transparent windows that cover the screen(s) and using SetSystemUIMode(), but I wouldn't recommend it. If you want your app to stay frontmost you should make it full screen.
 

MrFusion

macrumors 6502a
Jun 8, 2005
613
0
West-Europe
Hi, how do I store the x value of an NSPoint into a float? Thanks.

Also, how do I make my application stay the frontmost app (without it being fullscreen)?


NSPoint yourPoint = NSMakePoint(3,4);
float yourx = yourPoint.x;
yourPoint.y = 3+yourPoint.x*yourPoint.y; //not sure this would work correctly
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
NSPoint yourPoint = NSMakePoint(3,4);
float yourx = yourPoint.x;
yourPoint.y = 3+yourPoint.x*yourPoint.y; //not sure this would work correctly

That would work correctly for the most part, although to ensure readability/etc, I would replace '3' with '3.0' to ensure that the compiler produces a floating point literal (GCC should be okay, but better safe than sorry *g*).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.