I was planning to use a TextLabel control to display information in Rich Text format.
When I put a TextLabel on a form and enter some Rich Text using the little text editor, it works fine. But I want to import some external text (a user manual) to be displayed, stored in a seperate module or from an external file (.txt or .svg),
I did find a topic from Seany about ‘Rich Text Editor’ where Cogier suggests some solutions, but I cant’ get them to work. Error messages galore. Something to do with gb.qt4, gb.qt5 and such. I wanted to activate those but my Gambas version (3.14.3) didn’t like them.
This is what I’ve tried with a Form1 with a TextLabel1 on it and a Module1 :
' Gambas class file 'Form1 Public Sub Form_Open() With TextLabel1 .width = 300 .height = 200 .text = Module1.data() '.RichText = Module1.data() '???? End With End
' Gambas module file 'Module1 Public Text$ As String Public Edit$ As New String Public Sub data() As String Dim x As Integer Edit$ = "< p > < b > Welcome < / b > < / p >" Edit$ = "< p > There should be a way to display this Rich Text.</p>" Edit$ = "< p > But the .RichText option doesn't work any longer.< / p >" Edit$ = "< p > < b > Anyone know a way to do this? < / b > < / p >" Text$ = Edit$ For x = 1 To 3 Text$ = Text$ & Edit$[x] Next Return Text$ EndThe text gets returned, but TextLabel refuses to execute the HTML markup.