开发者

Using the FXFont class

开发者 https://www.devze.com 2023-01-20 19:53 出处:网络
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 fr

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消