Opened 9 years ago

Closed 9 years ago

#794 closed enhancement (fixed)

Change request to make setting AppDelegate easier

Reported by: plkrueger Owned by: rme
Priority: major Milestone:
Component: IDE Version: trunk
Keywords: Cc:

Description

Looking at init-cocoa-application it would seem that the intent there is to permit the use of a CCLDelegateClass attribute in the Info.plist as a way to set a different Application delegate class. This would be very convenient. Unfortunately if you do that, the delegate is then RESET in start-cocoa-application (after the call to init-cocoa-application). Although start-cocoa-application has a parameter that allows overriding of the default application delegate, using it would require also providing a new top-level function, which isn't as convenient. The setting of the app delegate in start-cocoa-application should be conditionalized by the non-existence of a current app delegate.

I suggest changing the code:

(when application-proxy-class-name ...)

in start-cocoa-application to :

(when (and application-proxy-class-name

(%null-ptr-p (#/delegate *NSApp*))) ...)

This would permit setting an application delegate either by using the Info.plist setting as described above or by specifying an application delegate in the main nib file that is set when that is loaded. Although I could do a bunch of work to work around this, I hope this change can be made fairly quickly.

Change History (2)

comment:1 Changed 9 years ago by rme

  • Owner set to rme
  • Status changed from new to assigned

comment:2 Changed 9 years ago by rme

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [14527]) In start-cocoa-application, don't set the application delegate if there is already a delegate (presumably set from the main nib file).

Fixes ticket:794.

Note: See TracTickets for help on using tickets.