[Gambas-user] textedit html behaviour

Ron ron at ...1740...
Wed Dec 2 20:50:52 CET 2009


Benoît Minisini schreef:
>>    Hi,
>>    I wanted to use a textEdit window to be able to do things like
>>  bold/colored text etc for individual lines.
>>    I noticed this behavoir:
>>        sText = "<b>Text</b>"
>>        FLogfiles.txtMainLog.Text = sText
>>    Displays:
>>    Text
>>        sText = "<b>Text</b>"
>>        FLogfiles.txtMainLog.Insert(sText)
>>    Displays:
>>    <b>Text</b>
>>    Is this expected behavior?
>>    Gambas 2.18.x
>>    gb.qt
>>    Ubuntu 9.10
>>    Regards,
>>    Ron_2nd.
>>     
>
> Yes, why?
>
>   

I would suspect that it doesn't matter how you supply content to an 
object (via .Text or .Insert() it should be displayed the same, now it 
doesn't, the content supplied with Insert() isn't parsed at all, as it 
displays all the html tags ins

I display my program logs inside 3 textAreas now, and I can simply set 
the cursor at last pos with .Pos = .Length and insert txt at the end 
without having it to append to a String variable which I have to create 
inside my program.

textEdit doesn't have a .Lenght property like textArea has, bit weird 
too, because the is a .Pos property...

With textEdit I can only do this if I keep a String variable myself and 
add to it, and set .Text to display the whole string everytime I open it.

On other thing (maybe hard to explain) I display the textAreas on a 
workspace, now if I close and reopen the form with the textAreas the 
content which I have inserted before is still there, with textEdit the 
areas start empty again.

I go back using textAreas without the ability to use bold/colored lines 
of text.
Maybe I see if I can build my own someday....Pitty...

Regards,
Ron_2nd.




More information about the User mailing list