mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
modify the message and comments on the source
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9e2f9cf233
commit
ec40d939af
2 changed files with 31 additions and 6 deletions
|
@ -17,13 +17,17 @@ $unicodeout_demo = TkToplevel.new {|w|
|
||||||
}
|
}
|
||||||
|
|
||||||
TkLabel.new($unicodeout_demo,
|
TkLabel.new($unicodeout_demo,
|
||||||
:font=>$font, :wraplength=>'4i', :justify=>:left,
|
:font=>$font, :wraplength=>'5.4i', :justify=>:left,
|
||||||
:text=><<EOL).pack(:side=>:top)
|
:text=><<EOL).pack(:side=>:top)
|
||||||
This is a sample of Tk's support for languages that use non-Western \
|
This is a sample of Tk's support for languages that use non-Western \
|
||||||
character sets. However, what you will actually see below depends \
|
character sets. However, what you will actually see below depends \
|
||||||
largely on what character sets you have installed, and what you see \
|
largely on what character sets you have installed, and what you see \
|
||||||
for characters that are not present varies greatly between platforms \
|
for characters that are not present varies greatly between platforms as well. \
|
||||||
as well. The strings are written in Tcl using UNICODE characters \
|
Please try to click the 'See Code' button, \
|
||||||
|
and click the 'Rerun Demo' button after editing \
|
||||||
|
(the source file is not changed) \
|
||||||
|
the definition of @@font on the Unicodeout_SampleFrame class.
|
||||||
|
The strings are written in Tcl using UNICODE characters \
|
||||||
using the \\uXXXX escape so as to do so in a portable fashion.
|
using the \\uXXXX escape so as to do so in a portable fashion.
|
||||||
|
|
||||||
ATTENTION:
|
ATTENTION:
|
||||||
|
@ -51,6 +55,13 @@ wait_msg = TkLabel.new($unicodeout_demo,
|
||||||
|
|
||||||
class Unicodeout_SampleFrame < TkFrame
|
class Unicodeout_SampleFrame < TkFrame
|
||||||
@@font = $font
|
@@font = $font
|
||||||
|
# @@font = 'Helvetica 14'
|
||||||
|
# @@font = 'Courier 12'
|
||||||
|
# @@font = 'clearlyu 16'
|
||||||
|
# @@font = 'fixed 12'
|
||||||
|
# @@font = 'Times 12'
|
||||||
|
# @@font = 'Newspaper 12'
|
||||||
|
# @@font = '{New century schoolbook} 12'
|
||||||
|
|
||||||
def initialize()
|
def initialize()
|
||||||
super($unicodeout_demo)
|
super($unicodeout_demo)
|
||||||
|
@ -61,6 +72,7 @@ class Unicodeout_SampleFrame < TkFrame
|
||||||
sample_txt = Tk::UTF8_String(args.join(''))
|
sample_txt = Tk::UTF8_String(args.join(''))
|
||||||
l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
|
l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
|
||||||
:anchor=>:nw, :pady=>0)
|
:anchor=>:nw, :pady=>0)
|
||||||
|
#s = TkLabel.new(self, :font=>@@font, :text=>sample_txt,
|
||||||
s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt,
|
s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt,
|
||||||
:anchor=>:nw, :width=>30, :pady=>0)
|
:anchor=>:nw, :width=>30, :pady=>0)
|
||||||
Tk.grid(l, s, :sticky=>:ew, :pady=>0)
|
Tk.grid(l, s, :sticky=>:ew, :pady=>0)
|
||||||
|
|
|
@ -17,16 +17,21 @@ $unicodeout_demo = TkToplevel.new {|w|
|
||||||
}
|
}
|
||||||
|
|
||||||
TkLabel.new($unicodeout_demo,
|
TkLabel.new($unicodeout_demo,
|
||||||
:font=>$font, :wraplength=>'4i', :justify=>:left,
|
:font=>$font, :wraplength=>'5.4i', :justify=>:left,
|
||||||
:text=><<EOL).pack(:side=>:top)
|
:text=><<EOL).pack(:side=>:top)
|
||||||
これは,Tkにおける非欧米文字集合を用いる言語に対するサポートについての\
|
これは,Tkにおける非欧米文字集合を用いる言語に対するサポートについての\
|
||||||
サンプルです.ただし,下の表示においてあなたが実際にどのような表示を\
|
サンプルです.ただし,下の表示においてあなたが実際にどのような表示を\
|
||||||
目にするかは,あなたの環境にどのような文字集合がインストールされているかに\
|
目にするかは,あなたの環境にどのような文字集合がインストールされているかに\
|
||||||
大きく依存します.また,対象となる文字集合がインストールされていない場合に\
|
大きく依存します.また,対象となる文字集合がインストールされていない場合に\
|
||||||
どのような表示がなされるかもあなたの環境次第です.\
|
どのような表示がなされるかもあなたの環境次第です.\
|
||||||
|
「コード参照」ボタンを押してソースを表示し,\
|
||||||
|
Unicodeout_SampleFrameクラスの@@fontの定義を書き換えて\
|
||||||
|
(ファイルの内容は変更されません)\
|
||||||
|
「再実行」ボタンのクリックを試してみてください.
|
||||||
スクリプトが可搬性を持つように,文字列は\\uXXXXという\
|
スクリプトが可搬性を持つように,文字列は\\uXXXXという\
|
||||||
Tclのエスケープ表現を用いたUNICODE文字列で書かれています.
|
Tclのエスケープ表現を用いたUNICODE文字列で書かれています.\
|
||||||
文字列はTk::UTF8_StringメソッドによってUTF8形式の文字列であるという\
|
文字列は,Tk::UTF8_Stringメソッドによって,\
|
||||||
|
「UTF8形式の文字列である」という\
|
||||||
エンコード情報付きの文字列オブジェクト\
|
エンコード情報付きの文字列オブジェクト\
|
||||||
(Tclのエスケープ表現の変換済み)に変換して\
|
(Tclのエスケープ表現の変換済み)に変換して\
|
||||||
ラベルウィジェットに渡している点に注意してください.
|
ラベルウィジェットに渡している点に注意してください.
|
||||||
|
@ -53,6 +58,13 @@ wait_msg = TkLabel.new($unicodeout_demo,
|
||||||
|
|
||||||
class Unicodeout_SampleFrame < TkFrame
|
class Unicodeout_SampleFrame < TkFrame
|
||||||
@@font = $font
|
@@font = $font
|
||||||
|
# @@font = 'Helvetica 14'
|
||||||
|
# @@font = 'Courier 12'
|
||||||
|
# @@font = 'clearlyu 16'
|
||||||
|
# @@font = 'fixed 12'
|
||||||
|
# @@font = 'Times 12'
|
||||||
|
# @@font = 'Newspaper 12'
|
||||||
|
# @@font = '{New century schoolbook} 12'
|
||||||
|
|
||||||
def initialize()
|
def initialize()
|
||||||
super($unicodeout_demo)
|
super($unicodeout_demo)
|
||||||
|
@ -63,6 +75,7 @@ class Unicodeout_SampleFrame < TkFrame
|
||||||
sample_txt = Tk::UTF8_String(args.join(''))
|
sample_txt = Tk::UTF8_String(args.join(''))
|
||||||
l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
|
l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
|
||||||
:anchor=>:nw, :pady=>0)
|
:anchor=>:nw, :pady=>0)
|
||||||
|
#s = TkLabel.new(self, :font=>@@font, :text=>sample_txt,
|
||||||
s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt,
|
s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt,
|
||||||
:anchor=>:nw, :width=>30, :pady=>0)
|
:anchor=>:nw, :width=>30, :pady=>0)
|
||||||
Tk.grid(l, s, :sticky=>:ew, :pady=>0)
|
Tk.grid(l, s, :sticky=>:ew, :pady=>0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue