Closed nnahito closed 4 years ago
import wNim/[wApp, wFrame, wTextCtrl, wFont]
let app = App()
let frame = Frame(title = "Hello World", size = (400, 300))
let textctrl = TextCtrl(frame, value = "", style = wBorderSunken or wTeMultiLine or wTeRich)
textctrl.value = "Foo\nBar"
textctrl.selection = 0..3
textctrl.formatSelection(Font(12), wRed, wWhite)
textctrl.setInsertionPointEnd()
frame.center()
frame.show()
app.mainLoop()
RTF related function will be added in next version.
Thank you for your reply! I was able to do what I wanted with the sample code you gave me! Thank you.
I look forward to the next update.
I want to use RichText. However, using wTeRich has no effect like:
I want to change the color of certain characters in TextControl. For example, change the word "Foo" to red.
I also tried loading an rtf file and displaying it in TextControl, but the text color did not change.
How do you do this? I would appreciate it if you could tell me.
Thank you.