Re: NSTextView created by hand and artifacts
Re: NSTextView created by hand and artifacts
- Subject: Re: NSTextView created by hand and artifacts
- From: Jim Mooney <email@hidden>
- Date: Thu, 31 May 2007 11:31:57 -0400
Cancel this post,
I found that the object returning from [[[notification userInfo]
objectForKey:NSViewFrameDidChangeNotification] was not the textfield
but something else. when I grabbed [[[notification object] superview]
setNeedsDisplay:TRUE]; it appears I get the right view and it does
redraw.
False alarm, life is good.
Jim
On May 31, 2007, at 11:08 AM, email@hidden wrote:
Greetings,
I wrote some code that creates text fields as needed since the
exact content to be added is unknown.
It works fine in where the field appear and you can edit the text.
However, when it comes time to delete characters from the field, I
have set the field to resize. Upon resizing, it appears that the
space to the right of the textfield, which itself is contained in
another NSView, shows partial characters of vertical bars from the
cursor. Seeing there is a notification I register the following
action when the size of the textfield changes as it either grows or
shrinks. I see that this notification fires and what is being
sent to it is the new textfield. However, as you can see, I ask
just about everyone to do something to update the region and it
does not. I ask the view containing the textfield to redraw, I ask
the window to redraw and nothing happens. The only thing that
erases the artifacts is resizing the window enough to force the
area to be redrawn.
I am beginning to think I have to draw over the section that
shrinks, but since I can't force the parent view to redraw, via --
superview] setNeedsDisplay:TRUE]-
I don't know what I am supposed to do. I thought of locking focus
on the rect of the area changed and force the background to
redraw......Would this mean I need an array of small portions to
NSViews that would be the fillers of the spaces as the textview
collapses? This seems to be a waste if the view has 50 fields and
I need to just redraw....seem easier to render the whole view
containing sibling fields.
Anyone have the lowdown on getting rid of the artifacts of
collapsing textfields?
- (void)textViewFrameChanged:(NSNotification *)notification{
[[[[notification userInfo]
objectForKey:NSViewFrameDidChangeNotification] superview]
setNeedsDisplay:TRUE];
//[[[notification userInfo]
objectForKey:NSViewFrameDidChangeNotification] setNeedsDisplay:TRUE];
//[[[[notification userInfo]
objectForKey:NSViewFrameDidChangeNotification] superview] display];
[[[[notification userInfo]
objectForKey:NSViewFrameDidChangeNotification] window] update];
NSLog(@"got called");
}
Yes I know there are a couple of commented lines.....on purposes in
the hunt to find out if any are firing and they don't appear to but
I do see Got called in the terminal
Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden