As the title says, Is there anyway to make web links clickable in the TextArea?
I have a lot of text in my TextArea and web address’s throughout, is there any way to allow the user to click on the website and have their browser open said website?
when the mouse is over the text area, scan the text below the cursor to get its start (http) and end (space), then if the user click, take the url and…
In the Language Reference, check TextArea: the Events.
Add MouseMove (I think),
In the Event, you will see the default parameters.
Go to the docs (link far above), and download the pdf. Read it, follow the examples (provided with the pdf), to learn a bit more. I cannot write a tutorial here.
Dont waste your time with that, there is no easy way to do it in a text area with xojo. If you don’t need that the user type, you can try with the HTMLviewer, you can catch the clicked links in the CancelLoad event
I once hacked together something using styleruns. Each stylerun corresponded to an index into an array of variants; the first stylerun corresponding to array(0), second stylerun to array(1), etc. In MouseMove I used CharPosAt and StyleRunRange to figure out which stylerun the mouse was over, and from there I could determine whether the stylerun was a link (non-link runs had Nil at their index in the array). It bogged down on longer texts but for a few KB it was fine.