Get height of desktop on Mac

BlitzMax Forums/BlitzMax Programming/Get height of desktop on Mac

Grey Alien(Posted 2007) [#1]
Anyone know how? hope that's an easy one but I'm having trouble finding out how in the docs. Thanks in advance if you can help!


grable(Posted 2007) [#2]
Does this work? its some old code for a module tweak i did...
void GetDesktopSize( width* int, height* int) {
	NSRect rect;
	rect = [[NSScreen deepestScreen] frame];
	*width = rect.size.width;
	*height = rect.size.height;
}
Extern 
	Function GetDesktopSize( width:Int Var, height:Int Var)
EndExtern



Grey Alien(Posted 2007) [#3]
Thx, looks viable, will try now.


Grey Alien(Posted 2007) [#4]
Looks like the params should be int *width, int *height.

Should NSREct be "freed" up at all? I might call this a lot you see...


Grey Alien(Posted 2007) [#5]
works like a charm, many thanks!


Barbapapa(Posted 2007) [#6]
Do you know this one..?? DesktopExtension 1.12


Grey Alien(Posted 2007) [#7]
sounds like it would have been useful thanks but I've done it myself now :-)


grable(Posted 2007) [#8]
Looks like the params should be int *width, int *height.

Lol! .. i guess ive gotten too used to blitzmax syntax ;)


Grey Alien(Posted 2007) [#9]
I still type delphi syntax every now and then!

btw: Should NSRect be "freed" up at all? I might call this a lot you see...


grable(Posted 2007) [#10]
Should NSRect be "freed" up at all? I might call this a lot you see...

I dont think so, its just a structure as far as i know.
(but do check the OSX dev info, as i dont know that much ObjectiveC)


Grey Alien(Posted 2007) [#11]
me neither and I doubt I'll understand what I read anyway :-)


grable(Posted 2007) [#12]
http://www.cocoadev.com/index.pl?NSRect the first site on google ;)
Its a structure alright. =)


Grey Alien(Posted 2007) [#13]
cool so a structure doesn't need to be freed.