Re: Redraw issue
- From: Brendan Murphy <bmurphy@xxxxxxxxxxxxxxxxxxxxx>
- To: ftcdev@xxxxxxxxxxxxx
- Date: Wed, 26 Mar 2008 09:34:22 -0500
Ron Benditt wrote:
I have RTF text saved in a string variable s. I then want to
display it in the FTC called Display, so I do this:
Display.getDoc.deleteAll
Display.setRTFText(s)
Display.resized
I find that I have to call the resized method afterwards in order to
make the RTF conform to the new size of the Display, which could be
changed at any time by the user. If I don't do this, centered text,
for example, does not look centered. This works very well on the
Mac. On Windows builds, I see the display first show the RTF in one
position, then I see the display "jump" as the text moves to a
slightly different location due to the resized method.
Is there any way to suppress the redraw during these steps, or am I
completely wet with how to best handle setting RTF in the FTC?
Oh, and in case you were wondering why I call the deleteAll
method... I've found that if I don't use it, I get duplicate RTF in
the FTC for some reason. Very weird, but solved by the deleteAll.
I didn't occur to me that it would be used in this manner. In the
demo application it only sets the content when a new window is
opened and it is an empty document. I need to add the logic you
have shown above to clear the content and do the resize (basically
for edit mode adjustments). I'll put it in the next preview.
FYI, if you are doing a lot of changes and you don't want multiple
updates to the display while you are changing the content, then
use the setInhibitUpdates method. Shown below is template on how
to do this.
Dim savedState as boolean
' Turn off updates.
savedState = setInhibitUpdates(true)
[your code here]
' Reset the update state to the previous state.
call setInhibitUpdates(savedState)
' Then call one of the these methods to invoke an update.
fullUpdate ' Does everything.
update(true, true) ' Updates everything that was marked dirty.
update ' Same as previous update, but waits for the next timer
invocation.
FTC Website: www.truenorthsoftware.com/Realbasic/FormattedText.html
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in
the subject field.
- References:
- Redraw issue
- From: Ron Benditt
Other related posts:
- » Redraw issue
- » Re: Redraw issue
Display.getDoc.deleteAll
Display.setRTFText(s)
Display.resized
I find that I have to call the resized method afterwards in order to
make the RTF conform to the new size of the Display, which could be
changed at any time by the user. If I don't do this, centered text,
for example, does not look centered. This works very well on the
Mac. On Windows builds, I see the display first show the RTF in one
position, then I see the display "jump" as the text moves to a
slightly different location due to the resized method.
Is there any way to suppress the redraw during these steps, or am I completely wet with how to best handle setting RTF in the FTC?
Oh, and in case you were wondering why I call the deleteAll method... I've found that if I don't use it, I get duplicate RTF in the FTC for some reason. Very weird, but solved by the deleteAll.
- Redraw issue
- From: Ron Benditt