开发者

In FXRuby when trying to specify a font I get an error "FXDCWindow::setFont: illegal or NULL font specified.", how to fix this?

In Ruby when 开发者_开发技巧trying to specify a font I get an error "FXDCWindow::setFont: illegal or NULL font specified.". I tried doing it like this:

@font = FXFont.new(app, 'times')

I need to set a font in order to use drawText in my program and I can't figure out how to. Oh and for the record I'm justt a beginner. Thanks!


According to the documentation, you need to specify the size at least. Try:

@font = FXFont.new(app, "times,12")


Make sure you're not trying to use the font object before it has been created; see http://www.fox-toolkit.org/faq.html#ILLEGALICON.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜