[PyObjC-svn] r2111 - trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/PythonBrowser

[email protected]
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Sun Mar 22 12:32:10 2009
New Revision: 2111

Log:
Remove NibClassBuilder usage

Added:
   trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/PythonBrowser/readme.txt
Modified:
   trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/PythonBrowser/   (props changed)
   trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/PythonBrowser/PythonBrowser.py

Modified: trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/PythonBrowser/PythonBrowser.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/PythonBrowser/PythonBrowser.py	(original)
+++ trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/PythonBrowser/PythonBrowser.py	Sun Mar 22 12:32:10 2009
@@ -24,19 +24,13 @@
 sources or nibs.)
 """
 
-from Foundation import NSObject
-from PyObjCTools import NibClassBuilder
+from Cocoa import *
 import sys
 
 
-NibClassBuilder.extractClasses("PythonBrowser")
-
-
 # class defined in PythonBrowser.nib
-class PythonBrowserWindowController(NibClassBuilder.AutoBaseClass):
-    # the actual base class is NSWindowController
-    # The following outlets are added to the class:
-    # outlineView
+class PythonBrowserWindowController(NSWindowController):
+    outlineView = objc.IBOutlet()
 
     def __new__(cls, obj):
         # "Pythonic" constructor
@@ -76,6 +70,7 @@
         self.model.setObject_(obj)
         self.outlineView.reloadData()
 
+    @objc.IBAction
     def doubleClick_(self, sender):
         # Open a new browser window for each selected expandable item
         for row in self.outlineView.selectedRowEnumerator():
@@ -83,6 +78,7 @@
             if item.isExpandable():
                 PythonBrowserWindowController(item.object)
 
+    @objc.IBAction
     def pickRandomModule_(self, sender):
         """Test method, hooked up from the "Pick Random Module" menu in
         MainMenu.nib, to test changing the browsed object after the window
@@ -99,6 +95,7 @@
     def applicationDidFinishLaunching_(self, notification):
         self.newBrowser_(self)
 
+    @objc.IBAction
     def newBrowser_(self, sender):
         # The PythonBrowserWindowController instance will retain itself,
         # so we don't (have to) keep track of all instances here.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.