[futurebasic] Re: [FB] sheet alerts from nibs and user data

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2009 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Thu, 31 Dec 2009 15:43:05 +1300
Waverly wrote:

> begin record SheetInfo
> dim as SInt32    sheetNumRef
> dim as WindowRef sheetW
> dim as WindowRef parentW
> end record


I don't think you need this record at all. Your handler (by requesting HICommandExtended) can discover the control that sent the HICommand. Then the sheet window is obtainable from GetControlOwner(), and the parent window from GetSheetWindowParent().


> err = fn RemoveEventHandler( fn GetWindowEventTarget( parentW ) )

This call will either crash or return an error. It will never remove an event handler, because you are passing it an EventTargetRef instead of an EventHandlerRef.

Robert P.