• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Restraining window movement + gridding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Restraining window movement + gridding


  • Subject: Re: Restraining window movement + gridding
  • From: Rolf Peder Klemetsen <email@hidden>
  • Date: Thu, 16 Oct 2003 20:47:28 +0200
  • Organization: Ontrax Custom Software Development AS

Hi Alstair,

Thanks.
I removed the [[NSNotificationCenter defaultCenter] addObserver. However the -
windowWillMove is still not being called. -windowWillResize is not being called either.
Interestingly -windowWillUpdate IS being called. So delegates are bing called but not the
two I need :-(

Kind regards,
Rolf

16.10.2003 12:24:46, skrev "Alastair J.Houghton" <email@hidden>:

>On Thursday, October 16, 2003, at 12:40 am, Rolf wrote:
>
>> Hi,
>>
>> I need to restrain window movement in my app as follows:
>> - Gridding: It must only allow to have origins that are evenly
>> divisible by X, for example 0,4,8,12, etc.
>> - Restrain: No sides are allowed to move outside of visible screen
>> area.
>>
>> I assume a possible solution to this is using
>> NSWindowWillMoveNotification. However the following does not work
>> (windowWillMove is never called), and I don't understand why:
>>
>>
>> [[NSNotificationCenter defaultCenter] addObserver:self
>> selector:@selector(windowWillMove:)
>> name:@"NSWindowWillMoveNotification" object:self];
>>
>
>Why do that? It's much easier just to set-up a delegate for your
>window; the delegate is automatically registered for the
>window-will-move notification by the NSWindow code. Plus, the way the
>above is written, it looks as if you have subclassed NSWindow, which is
>probably unnecessary.
>
>Just implement -windowWillMove: and -windowWillResize:toSize: on your
>delegate object.
>
>Kind regards,
>
>Alastair.
>_______________________________________________
>cocoa-dev mailing list | email@hidden
>Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Restraining window movement + gridding
      • From: mmalcolm crawford <email@hidden>
References: 
 >Re: Restraining window movement + gridding (From: "Alastair J.Houghton" <email@hidden>)

  • Prev by Date: Re: Memory Leak while using NSTask repeatedly
  • Next by Date: Re: Memory Leak while using NSTask repeatedly
  • Previous by thread: Re: Restraining window movement + gridding
  • Next by thread: Re: Restraining window movement + gridding
  • Index(es):
    • Date
    • Thread