Inspector Bar hiding and showing in NSTextView
Quote from Forum Archives on May 6, 2013, 10:53 pmPosted by: svanvoorst <svanvoorst@...>
This is a long shot without knowing anything about Inspector Bars, but is it in a view which could be refreshed with [.... setNeedsDisplay:YES];-----Original Message-----From: Brian S <[email protected]>
To: fbcocoa <[email protected]>
Sent: Mon, May 6, 2013 8:20 pm
Subject: [fbcocoa] Inspector Bar hiding and showing in NSTextView
Ok, back to what I supposed to be coding...A sheet window has an NSTextView and Inspector Bar is set ON in the nib. See screen print.The "Task Description" field is the NSTextView. My goal is to show the inspector bar when this field has focus and hide the inspector bar when the user is in some other text field like "Task Name".In order to intercept when the bar needs to be hidden/shown, I’m using two NSTextField delegate methods( see below ). NSLogs display appropriately but there is a problem. If I click on the NSTextView the inspector bar shows up ( per the nib ), now click on another text field and the inspector bar disappears. But if the NSTextView is clicked on again after the inspector bar disappears, it doesn’t fully come back. Instead a long horizontal bar shows up without the text controls. It looks like this:Any ideas for resolving this?- (void)textDidEndEditing:(NSNotification *)aNotification{
// [notification object] points to the control that has sent
// the notification
id theSentObject = [aNotification object];
if ( theSentObject == taskDescTaskSheet )
{
NSLog(@"NSTextView LOST focus");
[theSentObject setUsesInspectorBar:NO];
}
}
- (void)textDidBeginEditing:(NSNotification *)aNotification
{
id theSentObject = [aNotification object];
if ( theSentObject == taskDescTaskSheet )
{
NSLog(@"NSTextView GAINED focus");
[theSentObject setUsesInspectorBar:YES];
}
}
Brian S.
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Posted by: svanvoorst <svanvoorst@...>
From: Brian S <[email protected]>
To: fbcocoa <[email protected]>
Sent: Mon, May 6, 2013 8:20 pm
Subject: [fbcocoa] Inspector Bar hiding and showing in NSTextView


{
// [notification object] points to the control that has sent
// the notification
id theSentObject = [aNotification object];
if ( theSentObject == taskDescTaskSheet )
{
NSLog(@"NSTextView LOST focus");
[theSentObject setUsesInspectorBar:NO];
}
}
- (void)textDidBeginEditing:(NSNotification *)aNotification
{
id theSentObject = [aNotification object];
if ( theSentObject == taskDescTaskSheet )
{
NSLog(@"NSTextView GAINED focus");
[theSentObject setUsesInspectorBar:YES];
}
}
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]