mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-24 06:28:54 +00:00
In [setTextView] let the text view send frame changed notifications.
Check text view in [_textViewFrameChanged:]. Don't add observer if text view is nil in [setHeightTracksTextView:] and [setWidthTracksTextView:] git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7678 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
96d2900f7d
commit
c147e15baf
1 changed files with 13 additions and 0 deletions
|
@ -47,6 +47,11 @@
|
|||
NSSize inset;
|
||||
|
||||
textView = [aNotification object];
|
||||
if (textView != _textView)
|
||||
{
|
||||
NSDebugLog(@"NSTextContainer got notification for wrong View %@", textView);
|
||||
return;
|
||||
}
|
||||
newTextViewSize = [textView frame].size;
|
||||
newSize = _containerRect.size;
|
||||
inset = [textView textContainerInset];
|
||||
|
@ -132,6 +137,7 @@
|
|||
if (_textView)
|
||||
{
|
||||
[_textView setTextContainer: nil];
|
||||
[_textView setPostsFrameChangedNotifications: NO];
|
||||
[nc removeObserver: self name: NSViewFrameDidChangeNotification
|
||||
object: _textView];
|
||||
}
|
||||
|
@ -143,6 +149,7 @@
|
|||
[_textView setTextContainer: self];
|
||||
if (_observingFrameChanges)
|
||||
{
|
||||
[_textView setPostsFrameChangedNotifications: YES];
|
||||
[nc addObserver: self
|
||||
selector: @selector(_textViewFrameChanged:)
|
||||
name: NSViewFrameDidChangeNotification
|
||||
|
@ -176,6 +183,9 @@
|
|||
|
||||
_widthTracksTextView = flag;
|
||||
_observingFrameChanges = _widthTracksTextView | _heightTracksTextView;
|
||||
if (_textView == nil)
|
||||
return;
|
||||
|
||||
if (_observingFrameChanges)
|
||||
{
|
||||
[nc addObserver: self
|
||||
|
@ -202,6 +212,9 @@
|
|||
|
||||
_heightTracksTextView = flag;
|
||||
_observingFrameChanges = _widthTracksTextView | _heightTracksTextView;
|
||||
if (_textView == nil)
|
||||
return;
|
||||
|
||||
if (_observingFrameChanges)
|
||||
{
|
||||
[nc addObserver: self
|
||||
|
|
Loading…
Reference in a new issue