Re: forcing a textview to synchronize itself
Re: forcing a textview to synchronize itself
- Subject: Re: forcing a textview to synchronize itself
- From: James Derry <email@hidden>
- Date: Sun, 02 Mar 2003 21:45:29 -0500
Have you tried [textViewInstance sizeToFit]?
I had some weird behavior just today trying to get an NSTextView subclass to
toggle between word wrap and no word wrap, and sizeToFit seemed to work (as
long as you want word wrap to behave normally).
--Jim (me)
>
Date: Sun, 2 Mar 2003 13:07:16 -0800
>
From: matt neuburg <email@hidden>
>
Subject: forcing a textview to synchronize itself
>
>
I am, in code, collapsing and then later uncollapsing one of two
>
NSTextViews in a NSSplitView. (So that the user sees two textviews, then
>
one textview occupying the same space, then two textviews again.)
>
>
The first time I do this, I'm getting nonsense: everything looks okay at
>
first, but if I play around I find that the contents of the two textviews
>
are not right. For one thing, manually scrolling one of them scrolls
>
backwards - the "thumb" is hooked the wrong way to the movement of the
>
contents. And the other one is missing most of its contents.
>
>
At this point, however, manually resizing the window quite a bit and then
>
returning it to its original size solves the problem. And after that it
>
works right, forever, collapsing and uncollapsing. The problem happens
>
only the first time.
>
>
I'm guessing, therefore, that something in these NSTextViews is not
>
getting synchronized properly until I resize the window. The problem is I
>
can't find a command to give in code that will have the same effect. Does
>
anyone have any suggestions? I've tried (in code) slightly resizing the
>
window, calling display on everything in sight, zooming and unzooming,
>
asking the layout manager for the text container's glyph range, and lots
>
of other stuff, but I'm not getting the invocation right.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.