# SyntaxHighlightingEditField?

**URL:** <https://forum.xojo.com/t/syntaxhighlightingeditfield/14769>\
**Category:** Extras\
**Created:** [March 5, 2014, 12:59pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769 "2014-03-05T12:59:15Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias\_Maes](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@Mathias\_Maes](https://forum.xojo.com/u/Mathias_Maes)\
**Post date:** [March 5, 2014, 12:59pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/1 "2014-03-05T12:59:15Z")

</div>

Hello

I’m looking for a class named “SyntaxHighlightingEditField”, I think it’s created by Alex Restrepo. And I think [this](http://code.google.com/p/custom-editfield/) class is build on it. But custom editfield is way to big for me. I only want syntax highlighting, and that class worked with simple xml files.

But I can’t find it on Alex Restrepo’s GitHub.

Anyone has this class by chance?

Thanks

---

<div class="post-metadata">

**Author:** ![Axel\_Schneider](https://forum.xojo.com/user_avatar/forum.xojo.com/axel_schneider/32/465_2.png) [@Axel\_Schneider](https://forum.xojo.com/u/Axel_Schneider)\
**Post date:** [March 5, 2014, 3:10pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/2 "2014-03-05T15:10:12Z")

</div>

I’ve uploaded it here  
[Download](http://www.axel-erfurt.de/apps/SyntaxHighlightEditField.zip)

---

<div class="post-metadata">

**Author:** ![Mathias\_Maes](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@Mathias\_Maes](https://forum.xojo.com/u/Mathias_Maes)\
**Post date:** [March 5, 2014, 3:14pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/3 "2014-03-05T15:14:50Z")

</div>

Thanks Mr Schneider, you have no idea how much you’ve helped me!!

---

<div class="post-metadata">

**Author:** ![Axel\_Schneider](https://forum.xojo.com/user_avatar/forum.xojo.com/axel_schneider/32/465_2.png) [@Axel\_Schneider](https://forum.xojo.com/u/Axel_Schneider)\
**Post date:** [March 9, 2014, 12:33pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/4 "2014-03-09T12:33:56Z")

</div>

Do you have also the problem that it no longer works in XOJO with Cocoa?

> [@](#):
>
> Exception Message: A thread has attempted to manipulate a user interface element. This can only be done from the application’s main thread.

---

<div class="post-metadata">

**Author:** ![Mathias\_Maes](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@Mathias\_Maes](https://forum.xojo.com/u/Mathias_Maes)\
**Post date:** [March 9, 2014, 9:47pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/5 "2014-03-09T21:47:57Z")

</div>

I’m not using Xojo, but Realbasic. so I have no answer to that question.

Although, it’s very weird that a thread cannot manipulate an UI element. Maybe someone from Xojo can clear things up?

---

<div class="post-metadata">

**Author:** ![Axel\_Schneider](https://forum.xojo.com/user_avatar/forum.xojo.com/axel_schneider/32/465_2.png) [@Axel\_Schneider](https://forum.xojo.com/u/Axel_Schneider)\
**Post date:** [March 9, 2014, 10:07pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/6 "2014-03-09T22:07:52Z")

</div>

Yes, with Real Studio 2012 it works.

---

<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:** [March 9, 2014, 11:25pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/7 "2014-03-09T23:25:33Z")

</div>

> [@70292:@Mathias Maes](#):
>
> Although, it’s very weird that a thread cannot manipulate an UI element. Maybe someone from Xojo can clear things up?

Someone hasn’t been paying attention:

[http://www.xojo.com/blog/en/2013/06/accessing-the-user-interface-from-a-thread.php](http://www.xojo.com/blog/en/2013/06/accessing-the-user-interface-from-a-thread.php)

Has been discussed to death 

---

<div class="post-metadata">

**Author:** ![Axel\_Schneider](https://forum.xojo.com/user_avatar/forum.xojo.com/axel_schneider/32/465_2.png) [@Axel\_Schneider](https://forum.xojo.com/u/Axel_Schneider)\
**Post date:** [March 10, 2014, 8:29pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/8 "2014-03-10T20:29:35Z")

</div>

I have a way found to make it work in XOJO.  
I removed the HighlighterThread and put the Run Code into the Timer.  
It seems to work.

[Download SyntaxHighlightEditField2](http://www.axel-erfurt.de/apps/SyntaxHighlightEditField2.zip)

---

<div class="post-metadata">

**Author:** ![Franck\_Perez](https://forum.xojo.com/letter_avatar_proxy/v4/letter/f/c37758/32.png) [@Franck\_Perez](https://forum.xojo.com/u/Franck_Perez)\
**Post date:** [March 10, 2014, 9:55pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/9 "2014-03-10T21:55:42Z")

</div>

Thanks Alex. That’s very nice.  
The xml files containing the description of the highlight rules follow a generic structure or this is your own development. I mean, is it easy to find other descriptor files (like for Python, etc.) ?

---

<div class="post-metadata">

**Author:** ![Axel\_Schneider](https://forum.xojo.com/user_avatar/forum.xojo.com/axel_schneider/32/465_2.png) [@Axel\_Schneider](https://forum.xojo.com/u/Axel_Schneider)\
**Post date:** [March 10, 2014, 10:18pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/10 "2014-03-10T22:18:40Z")

</div>

here is a Python def , not perfect but useable, save it as xml in the definitions folder

[quote]\<?xml version="1.0" encoding="UTF-8"?\>  
  
Python  
  
  
/\_\_[  
\r]  
\_/_  
   
   
_#  
$_  
   
   
_‘’’  
‘’’_  
   
   
_def  
\040_  
   
   
_import  
\040_  
   
   
_"  
(((?\<!\\)(\\\\)_)|^)"  
  
  
  
if  
  
  
  
  
tkinter  
  
  
  
  
root  
  
  
  
  
attribute  
assert  
break  
class  
continue  
class  
def  
del  
elif  
except  
exec  
finally  
for  
global  
if  
implements  
in  
is  
lambda  
not  
or  
pass  
print  
raise  
return  
try  
while  
with  
yield  
true  
try  
expression  
boolean  
char  
double  
final  
float  
int  
long  
short  
static  
void  
  
  
  
(?\<=[^\w\d]|^)(((([0-9]+\.[0-9]_)|(\.[0-9]+))([eE][+\-]?[0-9]+)?[fFlL]?)|((([1-9][0-9]_)|0[0-7]\*|(0[xX][0-9a-fA-F]+))(([uU][lL]?)|([lL][uU]?))?))(?=[^\w\d]|$)  
  
  
(’.’)  
  
  
([A-Za-z0-9\_]+ \*)\(  
  
  
[/quote]

---

<div class="post-metadata">

**Author:** ![Axel\_Schneider](https://forum.xojo.com/user_avatar/forum.xojo.com/axel_schneider/32/465_2.png) [@Axel\_Schneider](https://forum.xojo.com/u/Axel_Schneider)\
**Post date:** [March 11, 2014, 5:15pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/11 "2014-03-11T17:15:50Z")

</div>

another Version with the Definitions inside the app.

[SHEField3.zip](http://www.axel-erfurt.de/apps/SHEField3.zip)

![](http://www.axel-erfurt.de/pics/SHEF3.png)

---

<div class="post-metadata">

**Author:** ![Mathias\_Maes](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@Mathias\_Maes](https://forum.xojo.com/u/Mathias_Maes)\
**Post date:** [March 11, 2014, 9:39pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/12 "2014-03-11T21:39:18Z")

</div>

[quote=70304:@Markus Winter]Someone hasn’t been paying attention:

[http://www.xojo.com/blog/en/2013/06/accessing-the-user-interface-from-a-thread.php](http://www.xojo.com/blog/en/2013/06/accessing-the-user-interface-from-a-thread.php)

Has been discussed to death [/quote]

Whoops, my bad. But I think it’s better this way.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:06pm UTC](https://forum.xojo.com/t/syntaxhighlightingeditfield/14769/13 "2020-10-29T17:06:32Z")

</div>


