# Help: Why does assigning StyledText to a TextArea so slow?

**URL:** <https://forum.xojo.com/t/help-why-does-assigning-styledtext-to-a-textarea-so-slow/55914>\
**Category:** General\
**Created:** [August 13, 2020, 8:22pm UTC](https://forum.xojo.com/t/help-why-does-assigning-styledtext-to-a-textarea-so-slow/55914 "2020-08-13T20:22:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Markus\_Winter](https://forum.xojo.com/user_avatar/forum.xojo.com/markus_winter/32/144_2.png) [@Markus\_Winter](https://forum.xojo.com/u/Markus_Winter)\
**Post date:** [August 13, 2020, 8:28pm UTC](https://forum.xojo.com/t/help-why-does-assigning-styledtext-to-a-textarea-so-slow/55914/2 "2020-08-13T20:28:48Z")

</div>

You should read [xDev](http://www.xdevmag.com) - was in my Tips&Tricks column 😉

```auto
Public Sub BeginFastEditing(Extends TA As TextArea)
  
  #If TargetCocoa Then
    
    Dim docView As Integer = TA.DocumentView
    ' Dim storage As Integer = TA.TextStorage( docView )
    Dim storage As Integer = TextStorage( docView )
    
    Declare Sub beginEditing Lib "AppKit" Selector "beginEditing" ( obj As Integer )
    beginEditing( storage )
    
  #EndIf
End Sub

```

and

```auto
Public Sub EndFastEditing(Extends TA As TextArea)
  
  #If TargetCocoa Then
    
    Dim docView As Integer = TA.DocumentView
    ' Dim storage As Integer = TA.TextStorage( docView )
    Dim storage As Integer = TextStorage( docView )
    
    Declare Sub endEditing Lib "AppKit" Selector "endEditing" ( obj As Integer )
    endEditing( storage )
    
  #Endif
End Sub

```

The display updates when you end the fast editing mode

```auto
MyTextArea.BeginFastEditing
MyTextArea.StyledText = st // This is no longer unbearably slow
MyTextArea.EndFastEditing

```

---

_[View the full topic](https://forum.xojo.com/t/help-why-does-assigning-styledtext-to-a-textarea-so-slow/55914)._
