NSWindowDidChangeScreenProfileNotification not working

  • Hi all,
    I've setup a notification profile changes but it doesn't work. Has
    anybody managed to get it working in Cocoa?

    Here's my code
        [[NSNotificationCenter defaultCenter] addObserver:self
    selector:@selector(cocoaScreenProfileChanged)
    name:NSWindowDidChangeScreenProfileNotification object:nil];

    Best
    Mark
  • Colon (:) is missing.

    [[NSNotificationCenter defaultCenter] addObserver:self
    selector:@selector(cocoaScreenProfileChanged:)
    name:NSWindowDidChangeScreenProfileNotification object:nil];

    On 27-Aug-07, at 3:00 PM, Mark wrote:

    > Hi all,
    > I've setup a notification profile changes but it doesn't work. Has
    > anybody managed to get it working in Cocoa?
    >
    > Here's my code
    > [[NSNotificationCenter defaultCenter] addObserver:self
    > selector:@selector(cocoaScreenProfileChanged)
    > name:NSWindowDidChangeScreenProfileNotification object:nil];
    >
    > Best
    > Mark
    >
  • Specifying Colon depends on the Notification handling method
    signature. If it accepts a argument then, you have to specify color
    there, otherwise not.

    On 27-Aug-07, at 3:00 PM, Mark wrote:

    > Hi all,
    > I've setup a notification profile changes but it doesn't work. Has
    > anybody managed to get it working in Cocoa?
    >
    > Here's my code
    > [[NSNotificationCenter defaultCenter] addObserver:self
    > selector:@selector(cocoaScreenProfileChanged)
    > name:NSWindowDidChangeScreenProfileNotification object:nil];
    >
    > Best
    > Mark
    >
  • Hi,

    that didn't solve the problem. I still get no notifications through
    Cocoa.

    Does that work for you?

    Best
    Mark

    On 27.08.2007, at 12:00, apparao wrote:

    > Specifying Colon depends on the Notification handling method
    > signature. If it accepts a argument then, you have to specify color
    > there, otherwise not.
    >
    >
    > On 27-Aug-07, at 3:00 PM, Mark wrote:
    >
    >> Hi all,
    >> I've setup a notification profile changes but it doesn't work. Has
    >> anybody managed to get it working in Cocoa?
    >>
    >> Here's my code
    >> [[NSNotificationCenter defaultCenter] addObserver:self
    >> selector:@selector(cocoaScreenProfileChanged)
    >> name:NSWindowDidChangeScreenProfileNotification object:nil];
    >>
    >> Best
    >> Mark
    >>

  • NSWindowDidChangeScreenNotification  -- Posted whenever a portion of
    an NSWindow object’s frame moves onto or off of a screen.

    Check whether window frame operation occurs in your application?.
    And also send that code including notification handler method. It
    would help us to trace out the problem.

    On 27-Aug-07, at 3:56 PM, Mark wrote:

    > Hi,
    >
    > that didn't solve the problem. I still get no notifications through
    > Cocoa.
    >
    > Does that work for you?
    >
    > Best
    > Mark
    >
    >
    >
    > On 27.08.2007, at 12:00, apparao wrote:
    >
    >> Specifying Colon depends on the Notification handling method
    >> signature. If it accepts a argument then, you have to specify
    >> color there, otherwise not.
    >>
    >>
    >> On 27-Aug-07, at 3:00 PM, Mark wrote:
    >>
    >>> Hi all,
    >>> I've setup a notification profile changes but it doesn't work.
    >>> Has anybody managed to get it working in Cocoa?
    >>>
    >>> Here's my code
    >>> [[NSNotificationCenter defaultCenter] addObserver:self
    >>> selector:@selector(cocoaScreenProfileChanged)
    >>> name:NSWindowDidChangeScreenProfileNotification object:nil];
    >>>
    >>> Best
    >>> Mark
    >>>

    >
    >
  • on 8/27/07 4:00 AM, <apparao...> purportedly said:

    > Specifying Colon depends on the Notification handling method
    > signature. If it accepts a argument then, you have to specify color
    > there, otherwise not.

    This is entirely incorrect. As spelled out in the docs:

    "
    - (void)addObserver:(id)notificationObserver
    selector:(SEL)notificationSelector name:(NSString *)notificationName
    object:(id)notificationSender

    <snip>

    notificationSelector
    Selector that specifies the message the receiver sends notificationObserver
    to notify it of the notification posting. The method the selector specifies
    must have one and only one argument.
    "

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
  • on 8/27/07 4:26 AM, <dev...> purportedly said:

    > that didn't solve the problem. I still get no notifications through
    > Cocoa.
    >
    > Does that work for you?

    Along with the other recommendations for more information, do you call
    -setDisplaysWhenScreenProfileChanges: on the window with a value of YES?
    Without this, the desired notification will never be sent.

    Best,

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
  • Thanks Keary,
    that was the problem, I was not aware that I nneded to set
    setDisplaysWhenScreenProfileChanges

    Best
    Mark

    On 27.08.2007, at 20:37, Keary Suska wrote:

    > on 8/27/07 4:26 AM, <dev...> purportedly said:
    >
    >> that didn't solve the problem. I still get no notifications through
    >> Cocoa.
    >>
    >> Does that work for you?
    >
    > Along with the other recommendations for more information, do you call
    > -setDisplaysWhenScreenProfileChanges: on the window with a value of
    > YES?
    > Without this, the desired notification will never be sent.
    >
    > Best,
    >
    > Keary Suska
    > Esoteritech, Inc.
    > "Demystifying technology for your home or business"
previous month august 2007 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today