• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /macosx-10.9.5/pyobjc-42/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/WebServicesTool/
1"""
2WSTApplicationDelegateClass
3
4An instance of this class is instantiated in the MainMenu.nib default NIB file.
5"""
6from Cocoa import *
7from WSTConnectionWindowControllerClass import WSTConnectionWindowController
8
9class WSTApplicationDelegate(NSObject):
10
11    @objc.IBAction
12    def newConnectionAction_(self, sender):
13        """Action method fired when the user selects the 'new connection'
14        menu item.  Note that the WSTConnectionWindowControllerClass is
15        defined the first time this method is invoked.
16
17        This kind of lazy evaluation is generally recommended;  it speeds
18        app launch time and it ensures that cycles aren't wasted loading
19        functionality that will never be used.
20
21        (In this case, it is largely moot due to the implementation of
22        applicationDidFinishLaunching_().
23        """
24        WSTConnectionWindowController.connectionWindowController().showWindow_(sender)
25
26    def applicationDidFinishLaunching_(self, aNotification):
27        """Create and display a new connection window
28        """
29        self.newConnectionAction_(None)
30