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

This commit is contained in:
Gregory Casamento 2021-06-24 19:01:00 -04:00
commit 6f623acdff
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2021-06-17 Riccardo Mottola <rm@gnu.org>
* Source/NSHelpPanel.m: (initWithContentRect)
When initializing the text view do not use the document view
of the scroll view which is not yet set and invalid.
(Fixes exceptions/crashes)
2021-05-20 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/AppKit.h: Add NSStackView.h to header.

View file

@ -138,7 +138,7 @@ static NSHelpPanel *_sharedPanel = nil;
{
NSScrollView *s;
NSTextView *v;
NSRect r;
NSSize size;
/* We have a standard start size.
*/
@ -159,8 +159,11 @@ static NSHelpPanel *_sharedPanel = nil;
[self setContentView: s];
RELEASE(s);
r = [[s documentView] frame];
v = [[NSTextView alloc] initWithFrame: r];
size = [NSScrollView contentSizeForFrameSize: contentRect.size
hasHorizontalScroller: YES
hasVerticalScroller: YES
borderType: NSNoBorder];
v = [[NSTextView alloc] initWithFrame: NSMakeRect(0, 0, size.width, size.height)];
[v setHorizontallyResizable: YES];
[v setVerticallyResizable: YES];
[v setEditable: NO];
@ -169,7 +172,7 @@ static NSHelpPanel *_sharedPanel = nil;
[v setMaxSize: NSMakeSize (1E7, 1E7)];
[v setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
[[v textContainer] setContainerSize:
NSMakeSize (MAX(r.size.width, 0.0), 1e7)];
NSMakeSize (MAX(size.width, 0.0), 1e7)];
[[v textContainer] setWidthTracksTextView: YES];
[s setDocumentView: v];