Skip to content

Commit

Permalink
Set textfields with Bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
halbtuerke committed Jun 25, 2009
1 parent 7d471cf commit deeee15
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 11 deletions.
7 changes: 1 addition & 6 deletions AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam
[alert beginSheetModalForWindow:mainWindow modalDelegate:self didEndSelector:nil contextInfo:nil];
} else {
self.inputFilePath = filename;
[inputFileField setStringValue:inputFilePath];
[inputChooseButton setTitle:@"Clear"];
[self toggleButton:inputChooseButton];
}

return YES;
Expand Down Expand Up @@ -81,7 +80,6 @@ - (void)inputChooserPanelDidEnd:(NSOpenPanel *)openPanel
// Did they choose "Open"?
if (returnCode == NSOKButton) {
self.inputFilePath = [openPanel filename];
[inputFileField setStringValue:inputFilePath];
[self toggleButton:inputChooseButton];
}
}
Expand Down Expand Up @@ -111,7 +109,6 @@ - (void)savePanelDidEnd:(NSSavePanel *)savePanel
{
if (returnCode == NSOKButton) {
self.outputFilePath = [savePanel filename];
[outputFileField setStringValue:outputFilePath];
[self toggleButton:outputChooseButton];
}
}
Expand All @@ -122,11 +119,9 @@ -(void)clear:(NSString *)which
{
if (which == @"INPUT") {
self.inputFilePath = nil;
[inputFileField setStringValue:@""];
[self toggleButton:inputChooseButton];
} else {
self.outputFilePath = nil;
[outputFileField setStringValue:@""];
[self toggleButton:outputChooseButton];
}
}
Expand Down
50 changes: 45 additions & 5 deletions English.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="493"/>
<integer value="372"/>
<integer value="106"/>
<integer value="372"/>
<integer value="493"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -935,6 +935,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
</object>
<object class="NSUserDefaultsController" id="415694897">
<bool key="NSSharedInstance">YES</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
Expand Down Expand Up @@ -1219,6 +1222,38 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">541</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: inputFilePath</string>
<reference key="source" ref="979542067"/>
<reference key="destination" ref="636125378"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="979542067"/>
<reference key="NSDestination" ref="636125378"/>
<string key="NSLabel">value: inputFilePath</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">inputFilePath</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">545</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: outputFilePath</string>
<reference key="source" ref="721523831"/>
<reference key="destination" ref="636125378"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="721523831"/>
<reference key="NSDestination" ref="636125378"/>
<string key="NSLabel">value: outputFilePath</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">outputFilePath</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">547</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -1737,6 +1772,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="object" ref="330062098"/>
<reference key="parent" ref="757601345"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">542</int>
<reference key="object" ref="415694897"/>
<reference key="parent" ref="1049"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
Expand Down Expand Up @@ -1923,8 +1963,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference ref="9"/>
<string>{74, 862}</string>
<string>{{6, 978}, {478, 20}}</string>
<string>{{115, 196}, {480, 172}}</string>
<string>{{115, 196}, {480, 172}}</string>
<string>{{144, 250}, {480, 172}}</string>
<string>{{144, 250}, {480, 172}}</string>
<reference ref="9"/>
<string>{{33, 99}, {480, 360}}</string>
<boolean value="YES" id="5"/>
Expand Down Expand Up @@ -2059,7 +2099,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">541</int>
<int key="maxID">547</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down

0 comments on commit deeee15

Please sign in to comment.