English 中文(简体)
不得改变Tk的体积
原标题:Cannot change font size in Tk

我第一次试图利用Tk,在鲁比建立一个全球调查。 我从众多网络辅导员中抽调了一部密码,试图改变一个标签的字体,但似乎没有影响案文的提交方式。

该法典:

require  tk 

root = TkRoot.new( title => MCIS )

defaultFont = TkFont.new("weight"=> bold , "size"=>20)

Lbl = TkLabel.new(root) do
    text "Boooo"
    borderwidth 5
    font defaultFont
    foreground  "red"
    relief      "groove"
    grid( column =>3,  row =>0)
end

Tk.mainloop()

我看到标签的所有参数的影响,但不见字体。 我试图改变规模、权重、给不同的姓氏、只留下一个参数;没有做什么——老板的停下来就象现在这样。 简言之,它没有报告任何错误,一切都看得上去。 难道这会引起问题吗? 我是这样说的:

  • Linux Centos 5
  • Tk 8.4.13
  • Ruby 1.8.5
  • ruby-tcltk 1.8.5

而且,我不知道这是否重要,而是通过温XP机器的Xming。

最佳回答

当我使用上述代码时,它按预期在我的班子台上运行,并安装连接显示器。 如果我不得不猜测,我可以说,Xming得到的体力支持极为有限,也许只能提供一只手形形形色体(现成:不可测量的)线。

因此,我要说,该守则是正确的,问题与X服务器配置有关。

问题回答

暂无回答




相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签