[futurebasic] Re: [FB] ascii text buffer to scrolling text field?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2010 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Tue, 18 May 2010 19:34:43 +1200
Jay Reeve wrote:

> I have a scrollview field (from a nib), and a large buffer (several mb) containing ascii characters. I would like to display the text buffer in the field without copying it. Will this fn (by RP) do that? Looking at TXNSetData, it looks like it would want to copy.
> 
> If this isn't the way, is there an efficient way to do what I'm looking for?

> local mode
> local fn TextViewSetText( txtView as HIViewRef, srcTxtPtr as pointer, srcTxtLen as long )
> '~'1
> dim as TXNObject txnObj
> dim as OSStatus err : err = _paramErr
> 
> txnObj = fn HITextViewGetTXNObject( txtView )
> long if ( txnObj)
> err = fn TXNSetData( txnObj, _kTXNTextData, srcTxtPtr, srcTxtLen, _kTXNStartOffset, _kTXNEndOffset )
> end if
> end fn = err

There's no other method (except saving the buffer as a file and reading TXN data from that).

Robert P.