Skip to content

Commit

Permalink
Conditionally set segment style in code, so XIB can compile without w…
Browse files Browse the repository at this point in the history
…arnins on 10.4. Fixes Issue #1
  • Loading branch information
ddribin committed May 25, 2009
1 parent 1979d4c commit 15227df
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 19 deletions.
1 change: 1 addition & 0 deletions lib/JRFeedbackController.h
Expand Up @@ -20,6 +20,7 @@ typedef enum {
IBOutlet NSTextField *nameTextField;
IBOutlet NSComboBox *emailAddressComboBox;
IBOutlet NSProgressIndicator *progress;
IBOutlet NSSegmentedControl *segmentedControl;

NSAttributedString *sectionStrings[JRFeedbackController_SectionCount];
JRFeedbackController_Section currentSection;
Expand Down
6 changes: 6 additions & 0 deletions lib/JRFeedbackController.m
Expand Up @@ -74,6 +74,12 @@ - (id)init {
}

- (void)windowDidLoad {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
// Not sure why, but you have to call this twice to "take" (10.5.7).
// First call always sets it to NSSegmentStyleRounded.
[segmentedControl setSegmentStyle:NSSegmentStyleTexturedSquare];
[segmentedControl setSegmentStyle:NSSegmentStyleTexturedSquare];
#endif
NSString* title = [NSString stringWithFormat:@"%@ Feedback", [[[NSBundle bundleForClass:[self class]] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey]];
[[self window] setTitle:title];

Expand Down
40 changes: 21 additions & 19 deletions lib/JRFeedbackProvider.xib
@@ -1,27 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02">
<data>
<int key="IBDocument.SystemTarget">1040</int>
<string key="IBDocument.SystemVersion">9G66</string>
<string key="IBDocument.InterfaceBuilderVersion">677</string>
<string key="IBDocument.AppKitVersion">949.43</string>
<string key="IBDocument.SystemVersion">9J61</string>
<string key="IBDocument.InterfaceBuilderVersion">672</string>
<string key="IBDocument.AppKitVersion">949.46</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="2"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1001">
Expand All @@ -44,14 +36,14 @@
<string key="NSWindowContentMaxSize">{492, 5000}</string>
<string key="NSWindowContentMinSize">{492, 393}</string>
<object class="NSView" key="NSWindowView" id="1006">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">319</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSSegmentedControl" id="61085660">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{19, 384}, {454, 25}}</string>
<string key="NSFrame">{{19, 385}, {458, 24}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="699074402">
Expand Down Expand Up @@ -84,7 +76,6 @@
<int key="NSSegmentItemImageScaling">2</int>
</object>
</object>
<int key="NSSegmentStyle">4</int>
</object>
</object>
<object class="NSScrollView" id="310502642">
Expand Down Expand Up @@ -584,6 +575,7 @@ ZWxwIHlvdT8KA</bytes>
</object>
</object>
<string key="NSFrameSize">{492, 428}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMinSize">{492, 415}</string>
Expand Down Expand Up @@ -729,6 +721,14 @@ ZWxwIHlvdT8KA</bytes>
</object>
<int key="connectionID">119</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">segmentedControl</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="61085660"/>
</object>
<int key="connectionID">120</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -960,10 +960,10 @@ ZWxwIHlvdT8KA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{602, 651}, {492, 428}}</string>
<string>{{314, 619}, {492, 428}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="8"/>
<string>{{602, 651}, {492, 428}}</string>
<string>{{314, 619}, {492, 428}}</string>
<reference ref="8"/>
<string>{196, 240}</string>
<string>{{49, 462}, {492, 394}}</string>
Expand Down Expand Up @@ -1013,7 +1013,7 @@ ZWxwIHlvdT8KA</bytes>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">119</int>
<int key="maxID">120</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down Expand Up @@ -1044,6 +1044,7 @@ ZWxwIHlvdT8KA</bytes>
<string>includeHardwareDetailsCheckbox</string>
<string>nameTextField</string>
<string>progress</string>
<string>segmentedControl</string>
<string>textView</string>
</object>
<object class="NSMutableArray" key="dict.values">
Expand All @@ -1052,6 +1053,7 @@ ZWxwIHlvdT8KA</bytes>
<string>NSButton</string>
<string>NSTextField</string>
<string>NSProgressIndicator</string>
<string>NSSegmentedControl</string>
<string>NSTextView</string>
</object>
</object>
Expand Down

0 comments on commit 15227df

Please sign in to comment.