Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gnustep/libs-gui
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed Sep 1, 2023
2 parents a658a82 + 3f35da7 commit 983bc7d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
8 changes: 7 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
2023-08-30 Gregory John Casamento <greg.casamento@gmail.com>

* Source/GSXib5KeyedUnarchive.m: Fix for issue#192. Added code to
-decodeObjectForXib:forClassName:withID: to decode toolTip using
alternative format described in the issue.

2023-08-13 Fred Kiefer <FredKiefer@gmx.de>

* Source/NSSwitch.m (-drawRect:): Correct drawing as suggested by
Austin Clow (dr_clow@me.com).
Austin Clow (dr_clow@me.com).

2023-02-12 Gregory John Casamento <greg.casamento@gmail.com>

Expand Down
36 changes: 27 additions & 9 deletions Source/GSXib5KeyedUnarchiver.m
Original file line number Diff line number Diff line change
Expand Up @@ -3169,6 +3169,31 @@ - (void) addOrderedObject: (GSXibElement*)element
}
}

- (void) addToolTip: (GSXibElement *)element forObject: (id)object
{
NSString *toolTipString = [element attributeForKey: @"toolTip"];

// Process tooltips...
if (toolTipString == nil)
{
GSXibElement *toolTipElement = [element elementForKey: @"toolTip"];

toolTipString = [toolTipElement value];
}

if (toolTipString != nil)
{
if ([object respondsToSelector: @selector(setToolTip:)])
{
[object setToolTip: toolTipString];
}
else if ([object respondsToSelector: @selector(setHeaderToolTip:)])
{
[object setHeaderToolTip: toolTipString];
}
}
}

- (id) decodeObjectForXib: (GSXibElement*)element
forClassName: (NSString*)classname
withID: (NSString*)objID
Expand All @@ -3177,15 +3202,8 @@ - (id) decodeObjectForXib: (GSXibElement*)element
id object = [super decodeObjectForXib: element forClassName: classname withID: objID];

[self addOrderedObject: element];

// Process tooltips...
if ([element attributeForKey: @"toolTip"])
{
if ([object respondsToSelector: @selector(setToolTip:)])
[object setToolTip: [element attributeForKey: @"toolTip"]];
else if ([object respondsToSelector: @selector(setHeaderToolTip:)])
[object setHeaderToolTip: [element attributeForKey: @"toolTip"]];
}
[self addToolTip: element forObject: object];

// Process IB runtime attributes for element...
// Ensure we don't process the placeholders...
if ([element elementForKey: @"userDefinedRuntimeAttributes"] &&
Expand Down
4 changes: 4 additions & 0 deletions Source/NSView.m
Original file line number Diff line number Diff line change
Expand Up @@ -5231,6 +5231,10 @@ - (CGFloat) firstBaselineOffsetFromTop
return 0;
}

- (void) awakeFromNib
{
}

@end

#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
Expand Down

0 comments on commit 983bc7d

Please sign in to comment.