khchen / wNim

Nim's Windows GUI Framework
MIT License
327 stars 17 forks source link

Can you change a text's color? #20

Closed dawkot closed 5 years ago

bunkford commented 5 years ago

You can use .setForegroundColor(color=wColor).

This can be a hex value (eg. 0xFFFFFF) or a constant as described here.

import wNim

let app = App()
let frame = Frame(title="Hello World", size=(400, 300))

var text = StaticText(frame, label="Hello, World!")
text.setForegroundColor(color=wRed)

frame.center()
frame.show()
app.mainLoop()
dawkot commented 5 years ago

Thank you.