Re: Proper way to retrieve the NSScreenNumber in a screen saver ?

2022-11-17 Thread Steve Mills via Cocoa-dev
> On Nov 17, 2022, at 16:11, Gabriel Zachmann via Cocoa-dev > wrote: > > Thanks a lot for your quick responses! > > I would like to understand what you are saying and what is going on, so > please bear with me. > > So, Steve, if I understand correctly, you suggest to write: > > - (void)

Re: Proper way to retrieve the NSScreenNumber in a screen saver ?

2022-11-17 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your quick responses! I would like to understand what you are saying and what is going on, so please bear with me. So, Steve, if I understand correctly, you suggest to write: - (void) viewWillMoveToWindow: (NSWindow *) newWindow { unsigned long my_screen =

test

2022-11-17 Thread David Young via Cocoa-dev
Testing, please disregard. Dave -- David Young dyo...@pobox.comUrbana, IL(217) 721-9981 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Re: Proper way to retrieve the NSScreenNumber in a screen saver ?

2022-11-17 Thread Steve Mills via Cocoa-dev
> On Nov 17, 2022, at 11:59, Jack Brindle via Cocoa-dev > wrote: > > The NSScreen screen property is nullable. From the docs for NSWindow screen: > > "The value of this property is the screen where most of the window is on; it > is nil when the window is offscreen." If a screensaver window

Re: Proper way to retrieve the NSScreenNumber in a screen saver ?

2022-11-17 Thread Jack Brindle via Cocoa-dev
The NSScreen screen property is nullable. From the docs for NSWindow screen: "The value of this property is the screen where most of the window is on; it is nil when the window is offscreen." I would go with Steve’s suggestion as much as possible, The NSScreen class has the info you need.

Re: Proper way to retrieve the NSScreenNumber in a screen saver ?

2022-11-17 Thread Steve Mills via Cocoa-dev
> On Nov 17, 2022, at 10:44, Gabriel Zachmann via Cocoa-dev > wrote: > > In my screensaver (macOS), > I am trying to retrieve the 'screen number' (NSScreenNumber) for the screen > on which I am running. [NSScreen.screens indexOfObject:window.screen] gives you the zero-based screen index. 0

Proper way to retrieve the NSScreenNumber in a screen saver ?

2022-11-17 Thread Gabriel Zachmann via Cocoa-dev
In my screensaver (macOS), I am trying to retrieve the 'screen number' (NSScreenNumber) for the screen on which I am running. So, in - (void) viewWillMoveToWindow: (NSWindow *) newWindow I have this line of code: displayID_ = [ [[newWindow screen] deviceDescription] objectForKey: