Skip to content

Instantly share code, notes, and snippets.

@boucher
Created September 17, 2008 20:27
Show Gist options
  • Save boucher/11301 to your computer and use it in GitHub Desktop.
Save boucher/11301 to your computer and use it in GitHub Desktop.
diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j
index 2737de9..6e2c32d 100644
--- a/AppKit/CPTextField.j
+++ b/AppKit/CPTextField.j
@@ -468,7 +468,8 @@ var _CPTextFieldSquareBezelColor = nil;
var CPTextFieldIsSelectableKey = @"CPTextFieldIsSelectableKey",
CPTextFieldLineBreakModeKey = @"CPTextFieldLineBreakModeKey",
- CPTextFieldStringValueKey = @"CPTextFieldStringValueKey";
+ CPTextFieldStringValueKey = @"CPTextFieldStringValueKey",
+ CPTextFieldIsEditableKey = @"CPTextFieldIsEditableKey";
@implementation CPTextField (CPCoding)
@@ -503,6 +504,7 @@ var CPTextFieldIsSelectableKey = @"CPTextFieldIsSelectableKey",
_DOMElement.appendChild(_DOMTextElement);
#endif
+ [self setEditable:[aCoder decodeBoolForKey:CPTextFieldIsEditableKey]];
[self setSelectable:[aCoder decodeBoolForKey:CPTextFieldIsSelectableKey]];
[self setLineBreakMode:[aCoder decodeIntForKey:CPTextFieldLineBreakModeKey]];
@@ -526,6 +528,8 @@ var CPTextFieldIsSelectableKey = @"CPTextFieldIsSelectableKey",
[aCoder encodeInt:_lineBreakMode forKey:CPTextFieldLineBreakModeKey];
[aCoder encodeObject:_value forKey:CPTextFieldStringValueKey];
+
+ [aCoder encodeBool:_isEditable forKey:CPTextFieldIsEditableKey];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment