Page 1 of 1

Scintilla questions [Solved]

Posted: Mon Nov 19, 2007 8:20 am
by Beach
I am using the Scintilla code example found here: http://www.purebasic.fr/english/viewtopic.php?t=29320

I am able to add text to the gadget successfully with the following code:

Code: Select all

text = "testing 1 2 3" + Chr(10)
ScintillaSendMessage(#SciID, #SCI_ADDTEXT,Len(text),@text)
But I would like to be able to change the color of the font on a per line basis. Almost like syntax highlighting, except I want to color the whole line. I would not have more than two different colors though, just enough to distinguish one from the other.

Also, since I am adding the text with code, the window does not scroll with the text. I see options to do this in the documentation but nothing I tried works. Basically, I would like the Scintilla window to always show the last line.

Any clues how to do this? I could show you what I have so far but it is not that different from the code sample on the page above.

Posted: Wed Nov 21, 2007 8:46 am
by Beach
I kept tinkering around with the Scintilla commands and I have what I was looking for. I am sure what I have done is not the best way to get there, and I am way open for suggestions/criticism...

Here is the code, rather large to dump in a message so I'm linking to it here:
scintilla_example.pb

Works on Windows and Linux - which is nice...