how do you use the 开发者_如何转开发FXFont class on FXRuby so that you can change the font and color of the text on your application? THANKS!
The typeface or font used for text is a separate concept from the text color.
Suppose we're dealing with an FXLabel widget. If you want to change the font used for the label, you can set that using the label's "font" attribute, e.g.
label = FXLabel.new(...)
labelFont = FXFont.new(...)
labelFont.create
label.font = labelFont
On the other hand, if you want to change the label's text color, assign to its "textColor" attribute, e.g.
label.textColor = FXRGB(255, 0, 0)
Hope this helps.
精彩评论