mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 13:20:47 +00:00
Add code to decode enabled state for switch
This commit is contained in:
parent
fdd51ae2df
commit
1a2ff4a40c
1 changed files with 16 additions and 0 deletions
|
@ -2799,6 +2799,22 @@ didStartElement: (NSString*)elementName
|
|||
NSControlStateValueOn : NSControlStateValueOff];
|
||||
}
|
||||
}
|
||||
|
||||
if ([element attributeForKey: @"enabled"])
|
||||
{
|
||||
if ([object respondsToSelector: @selector(setEnabled:)] && [object isKindOfClass: [NSSwitch class]])
|
||||
{
|
||||
[(NSSwitch *)object setEnabled: [[element attributeForKey: @"enabled"] isEqualToString: @"YES"] ?
|
||||
YES : NO];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([object respondsToSelector: @selector(setEnabled:)] && [object isKindOfClass: [NSSwitch class]])
|
||||
{
|
||||
[(NSSwitch *)object setEnabled: YES];
|
||||
}
|
||||
}
|
||||
|
||||
// Process IB runtime attributes for element...
|
||||
// Ensure we don't process the placeholders...
|
||||
|
|
Loading…
Reference in a new issue