texteditor.gadget text formatting questions

Online Status

Hello,

I'd like to do basic font formatting within texteditor.gadget. I've tried using basic control sequences but nothing seems to happen. Can't really find anything the header files either. I'm thinking, maybe add a listener that looks for said sequences and calls SetFont() against the gadgets rastport? There must be an easy way :)

-M

Online Status

It doesn't do multi fonts (and never will as it is not a full word processing gadget), but as you can see from the highlighting in TextEdit, it is capable of changing color, italic, bold and underline settings.
The catch is that right now highlighting is the only way to do it. The attributes to do it onto the text itself are not functional. The highlighting happens through a listener where your hook will be called on the lines when needed.

In short:
- the setter attributes don't work
- loading a file does set formatting
- editing such a loaded file will mess up the formatting
- only way at the moment is through a highlighter - and that will likely not do what you want

Online Status

Ok, just coming back to this. If add a highlight hook, does it get called when the text editor is in read-only mode? I want to format logging output (read-only), and I'm adding the lines programatically. I'm using hooks elsewhere in my app, but for whatever reason the highlight hook just wouldn't fire!

Online Status

I do believe it will work in readonly mode too. After you have set the contents the highlighter will be called. Maybe you have given the highlighter ptr after the contents ?