home *** CD-ROM | disk | FTP | other *** search
- /*
- You may freely copy, distribute, and reuse the code in this example.
- NeXT disclaims any warranty of any kind, expressed or implied, as to its
- fitness for any particular use.
- */
-
- #import "ConverterController.h"
- #import "Converter.h"
-
- @implementation ConverterController
-
- - (void)convert:(id)sender
- {
- float rate, amount, total=0.0;
-
- amount = [dollarField floatValue];
- rate = [rateField floatValue];
- total = [converter convertAmount:amount byRate:rate];
- [totalField setFloatValue:total];
- [rateField selectText:self];
- }
-
- - (void)awakeFromNib
- {
- [rateField selectText:self];
- [[rateField window] makeKeyAndOrderFront:self];
- }
-
- @end
-