Merge branch 'master' of github.com:gnustep/libs-gui into NSBrowser_bindings_branch

This commit is contained in:
Gregory John Casamento 2024-11-06 09:39:30 -05:00
commit 557796af5d
2 changed files with 35 additions and 13 deletions

View file

@ -1265,6 +1265,8 @@ APPKIT_EXPORT_CLASS
- (NSRect) browserHeaderDrawingRectForCell: (NSTableHeaderCell*)cell
withFrame: (NSRect)rect;
- (CGFloat) tabHeightForType: (NSTabViewType)type;
- (NSRect) tabViewContentRectForBounds: (NSRect)aRect
tabViewType: (NSTabViewType)type
tabView: (NSTabView *)view;
@ -1275,6 +1277,10 @@ APPKIT_EXPORT_CLASS
- (NSRect) tabViewBackgroundRectForBounds: (NSRect)aRect
tabViewType: (NSTabViewType)type;
- (void) drawTabViewBezelRect: (NSRect)aRect
tabViewType: (NSTabViewType)type
inView: (NSView *)view;
- (void) drawTabViewRect: (NSRect)rect
inView: (NSView *)view
withItems: (NSArray *)items

View file

@ -1775,23 +1775,39 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect)
}
else
{
id object = nil;
if (_dataSource == nil)
{
NSLog(@"%@: No data source currently specified", self);
return nil;
}
else if ([_dataSource respondsToSelector:
@selector(comboBox:objectValueForItemAtIndex:)])
NSLog(@"%@: No data source currently specified", self);
}
else if ([_dataSource respondsToSelector:
@selector(comboBox:objectValueForItemAtIndex:)])
{
return [[_dataSource comboBox: (NSComboBox *)[self controlView]
objectValueForItemAtIndex: index] description];
}
else if ([_dataSource respondsToSelector:
@selector(comboBoxCell:objectValueForItemAtIndex:)])
object = [_dataSource comboBox: (NSComboBox *)[self controlView]
objectValueForItemAtIndex: index];
}
else if ([_dataSource respondsToSelector:
@selector(comboBoxCell:objectValueForItemAtIndex:)])
{
return [[_dataSource comboBoxCell: self
objectValueForItemAtIndex: index] description];
}
object = [_dataSource comboBoxCell: self objectValueForItemAtIndex: index];
}
if (object)
{
// Check for attributed string type and return actual string instead..
if ([object isKindOfClass: [NSAttributedString class]])
{
object = [object string];
}
else
{
object = [object description];
}
// Return the request object...
return object;
}
}
return nil;