Author: ronaldoussoren
Date: Sun Mar 22 11:57:46 2009
New Revision: 2108
Log:
Remove NibClassBuilder usage
Modified:
trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/CurrencyConverter/ (props changed)
trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/CurrencyConverter/CurrencyConverter.py
Modified: trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/CurrencyConverter/CurrencyConverter.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/CurrencyConverter/CurrencyConverter.py (original)
+++ trunk/pyobjc/pyobjc-framework-Cocoa/Examples/AppKit/CurrencyConverter/CurrencyConverter.py Sun Mar 22 11:57:46 2009
@@ -1,29 +1,29 @@
import time
import sys
-from Foundation import NSObject
-from AppKit import NSApplicationMain
-from PyObjCTools import NibClassBuilder
-from AppKit import NSRunAlertPanel
-from objc import *
+from AppKit import *
-NibClassBuilder.extractClasses('MainMenu.nib')
-class Converter (NibClassBuilder.AutoBaseClass):
+class Converter (NSObject):
def convertAmount(self, amt, rate):
return amt*rate
-class ConverterController (NibClassBuilder.AutoBaseClass):
+class ConverterController (NSObject):
# First define the IB Outlets, the 'ivar' calls below define new
# instance variables in the objective-C class (e.g. visible
# for introspection in objective-C)
+ converter = objc.IBOutlet()
+ dollarField = objc.IBOutlet()
+ rateField = objc.IBOutlet()
+ totalField = objc.IBOutlet()
def awakeFromNib(self):
# Provide some defaults for the user...
self.dollarField.setFloatValue_(2.0)
self.rateField.setFloatValue_(3.0)
+ @objc.IBAction
def convert_(self, sender):
rate = self.rateField.floatValue()
amt = self.dollarField.floatValue()
@@ -32,8 +32,8 @@
self.totalField.setFloatValue_(total)
self.rateField.selectText_(self)
- x = NSRunAlertPanel("Calculation Result",
- "The result is %s"%(total), "OK", None, None)
+ #x = NSRunAlertPanel("Calculation Result",
+ # "The result is %s"%(total), "OK", None, None)
sys.exit(NSApplicationMain(sys.argv))
------------------------------------------------------------------------------
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.