realbasic-nug
[Top] [All Lists]

Re: Storing the contents of a styled editfield...

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Storing the contents of a styled editfield...
From: Charles Yeomans <charles@declareSub.com>
Date: Tue, 30 Jun 2009 12:13:31 -0400
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <839A347D-2C6B-474A-86E3-53B7D4F9DE96@gmail.com>
References: <839A347D-2C6B-474A-86E3-53B7D4F9DE96@gmail.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Jun 30, 2009, at 11:56 AM, Jann Gobble wrote:

Hi all,

My IM project inside my App is off the ground and working!  Yippee..

However, one thing. I have an IM window where the conversation is on top and the user entry field is below. The conversation field is styled to make it easy to see your text vs theirs (yours in blue, theirs in red -- with either of your names bolded). When a user closes an IM window during a conversation ... and the other user (on the other side of the conversation) sends them a response, I would like to redisplay the window with the original conversation still in the editfield.

My main question is this: I know I can store the TEXT portion of the editfield in a string variable and redisplay it if needed but is there a way to store the text and style portions in a variable.

I guess what I would LOVE to do is the equivalent of a Perl Freeze/ Thaw. Whereby i can freeze a data structure such as an editfield -- or the contents thereof, store it in a text variable and thaw it back out later to put back as the contents of the editfield.

Does such a puppy exist?


Sort of. You can save the StyledText object returned by an EditField to a variable, and assign it to a new EditField. There is at least one gotcha, though; Rb is a little too casual about the implementation of this property, and so I can never remember whether or not you must copy this StyledText object. The code for doing so has been posted to this list in the past, so you might search for it.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>