From 2fecb27eb47333fda1e0049584d6b56dd336197f Mon Sep 17 00:00:00 2001 From: ayumin Date: Wed, 14 Sep 2011 17:25:37 +0000 Subject: Merge branch 'tk_utf8' into trunk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 + ext/tk/MANUAL_tcltklib.eucj | 822 ++++++++++++------------- ext/tk/README.1st | 14 +- ext/tk/lib/tcltk.rb | 2 +- ext/tk/old-README.tcltklib.eucj | 206 +++---- ext/tk/sample/demos-en/README | 114 ++-- ext/tk/sample/demos-en/README.tkencoding | 18 +- ext/tk/sample/demos-jp/README | 102 +-- ext/tk/sample/demos-jp/README.1st | 28 +- ext/tk/sample/demos-jp/anilabel.rb | 22 +- ext/tk/sample/demos-jp/aniwave.rb | 10 +- ext/tk/sample/demos-jp/arrow.rb | 22 +- ext/tk/sample/demos-jp/bind.rb | 38 +- ext/tk/sample/demos-jp/bitmap.rb | 20 +- ext/tk/sample/demos-jp/button.rb | 20 +- ext/tk/sample/demos-jp/check.rb | 30 +- ext/tk/sample/demos-jp/check2.rb | 30 +- ext/tk/sample/demos-jp/clrpick.rb | 28 +- ext/tk/sample/demos-jp/colors.rb | 20 +- ext/tk/sample/demos-jp/combo.rb | 36 +- ext/tk/sample/demos-jp/cscroll.rb | 22 +- ext/tk/sample/demos-jp/ctext.rb | 36 +- ext/tk/sample/demos-jp/dialog1.rb | 12 +- ext/tk/sample/demos-jp/dialog2.rb | 12 +- ext/tk/sample/demos-jp/entry1.rb | 32 +- ext/tk/sample/demos-jp/entry2.rb | 32 +- ext/tk/sample/demos-jp/entry3.rb | 46 +- ext/tk/sample/demos-jp/filebox.rb | 28 +- ext/tk/sample/demos-jp/floor.rb | 24 +- ext/tk/sample/demos-jp/floor2.rb | 24 +- ext/tk/sample/demos-jp/form.rb | 28 +- ext/tk/sample/demos-jp/goldberg.rb | 20 +- ext/tk/sample/demos-jp/hello | 6 +- ext/tk/sample/demos-jp/hscale.rb | 14 +- ext/tk/sample/demos-jp/icon.rb | 24 +- ext/tk/sample/demos-jp/image1.rb | 22 +- ext/tk/sample/demos-jp/image2.rb | 34 +- ext/tk/sample/demos-jp/image3.rb | 18 +- ext/tk/sample/demos-jp/items.rb | 60 +- ext/tk/sample/demos-jp/ixset2 | 40 +- ext/tk/sample/demos-jp/knightstour.rb | 20 +- ext/tk/sample/demos-jp/label.rb | 30 +- ext/tk/sample/demos-jp/labelframe.rb | 32 +- ext/tk/sample/demos-jp/mclist.rb | 58 +- ext/tk/sample/demos-jp/menu.rb | 108 ++-- ext/tk/sample/demos-jp/menu84.rb | 50 +- ext/tk/sample/demos-jp/menu8x.rb | 120 ++-- ext/tk/sample/demos-jp/menubu.rb | 28 +- ext/tk/sample/demos-jp/msgbox.rb | 30 +- ext/tk/sample/demos-jp/msgbox2.rb | 32 +- ext/tk/sample/demos-jp/paned1.rb | 16 +- ext/tk/sample/demos-jp/paned2.rb | 22 +- ext/tk/sample/demos-jp/pendulum.rb | 10 +- ext/tk/sample/demos-jp/plot.rb | 26 +- ext/tk/sample/demos-jp/puzzle.rb | 30 +- ext/tk/sample/demos-jp/radio.rb | 30 +- ext/tk/sample/demos-jp/radio2.rb | 26 +- ext/tk/sample/demos-jp/radio3.rb | 24 +- ext/tk/sample/demos-jp/rolodex-j | 132 ++-- ext/tk/sample/demos-jp/ruler.rb | 22 +- ext/tk/sample/demos-jp/sayings.rb | 20 +- ext/tk/sample/demos-jp/search.rb | 40 +- ext/tk/sample/demos-jp/spin.rb | 42 +- ext/tk/sample/demos-jp/states.rb | 34 +- ext/tk/sample/demos-jp/style.rb | 192 +++--- ext/tk/sample/demos-jp/tcolor | 34 +- ext/tk/sample/demos-jp/text.rb | 102 +-- ext/tk/sample/demos-jp/textpeer.rb | 32 +- ext/tk/sample/demos-jp/toolbar.rb | 56 +- ext/tk/sample/demos-jp/tree.rb | 22 +- ext/tk/sample/demos-jp/ttkbut.rb | 56 +- ext/tk/sample/demos-jp/ttkmenu.rb | 46 +- ext/tk/sample/demos-jp/ttknote.rb | 42 +- ext/tk/sample/demos-jp/ttkpane.rb | 24 +- ext/tk/sample/demos-jp/ttkprogress.rb | 26 +- ext/tk/sample/demos-jp/twind.rb | 76 +-- ext/tk/sample/demos-jp/twind2.rb | 116 ++-- ext/tk/sample/demos-jp/unicodeout.rb | 42 +- ext/tk/sample/demos-jp/vscale.rb | 16 +- ext/tk/sample/demos-jp/widget | 316 +++++----- ext/tk/sample/msgs_rb2/ja.msg | 154 ++--- ext/tk/sample/tcltklib/sample0.rb | 12 +- ext/tk/sample/tcltklib/sample1.rb | 304 ++++----- ext/tk/sample/tcltklib/sample2.rb | 14 +- ext/tk/sample/tkextlib/tkHTML/page1/index.html | 2 +- ext/tk/sample/tkoptdb-safeTk.rb | 2 +- ext/tk/sample/tkoptdb.rb | 2 +- 87 files changed, 2397 insertions(+), 2393 deletions(-) diff --git a/ChangeLog b/ChangeLog index 034c05ea1d..9c5862dbe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Sep 15 01:44:10 2011 Ayumu AIZAWA + + * ext/tk/*: Change encoding from EUC-JP to UTF-8 + Wed Sep 14 11:43:37 2011 KOSAKI Motohiro * thread.c (rb_fd_rcopy): added an argument guard. diff --git a/ext/tk/MANUAL_tcltklib.eucj b/ext/tk/MANUAL_tcltklib.eucj index 1ff5dddde4..1de1736f9f 100644 --- a/ext/tk/MANUAL_tcltklib.eucj +++ b/ext/tk/MANUAL_tcltklib.eucj @@ -1,525 +1,525 @@ (tof) 2005/07/05 Hidetoshi NAGAI -本ドキュメントには古い tcltk ライブラリ,tcltklib ライブラリの説明 -が含まれていますが,その記述内容は古いものとなっています. +ャ<潟ゃ tcltk ゃ鐚tcltklib ゃ茯 +障障鐚荐菴医絎鴻ゃc障鐚 -tcltk ライブラリ(tcltk.rb)は現在ではメンテナンスが事実上行われて -いないため,古いドキュメントの説明がそのまま有効です.それに対し, -tcltklib ライブラリについては,現在の Ruby/Tk(tk.rb 以下のライブラ -リ群)を稼働させるための中心としてメンテナンスされているため,少々 -違いが生じています. +tcltk ゃ鐚tcltk.rb鐚憜с<潟潟鴻篋絎筝茵 +鐚ゃャ<潟茯障丈鴻с鐚絲障鐚 +tcltklib ゃゃ鐚憜 Ruby/Tk鐚tk.rb 篁ヤゃ +臂わ腮弱筝綽<潟潟鴻鐚絨 +障鐚 -そこで,まず古い説明文書を示した後,現在の tcltklib ライブラリにつ -いての説明を加えます. +э障ゃ茯吾腓冴緇鐚憜 tcltklib ゃ +茯障鐚 -以下がライブラリの古い説明文書です. +篁ヤゃゃ茯吾с鐚 ============================================================== MANUAL.euc Sep. 19, 1997 Y. Shigehiro -以下, 「tcl/tk」という表記は, tclsh や wish を実現している, 一般でいう -ところの tcl/tk を指します. 「tcltk ライブラリ」, 「tcltklib ライブラ -リ」という表記は, 本パッケージに含まれる ruby 用のライブラリを指します. +篁ヤ, tcl/tk茵荐, tclsh wish 絎憗, 筝с + tcl/tk 障. tcltk ゃ, tcltklib ゃ +茵荐, 宴若吾障 ruby ゃ障. -<< tcltk ライブラリ >> +<< tcltk ゃ >> -tcl/tk の C ライブラリを利用するための高(中?)水準インターフェースを提 -供します. +tcl/tk C ゃ蕭(筝?)羂贋ゃ潟帥若с若鴻 +箴障. -このライブラリは ruby から tcl/tk ライブラリを利用するためのもので, 内 -部で tcltklib ライブラリを利用しています. +ゃ ruby tcl/tk ゃ, + tcltklib ゃ障. -[説明] +[茯] -tcl/tk インタプリタでは, ウィジェットに何か指示を送るには, ウィジェッ -ト名に続いてパラメータを書きます. したがって, ウィジェットがオブジェク -トであり, それに対してメソッドを送っている, とみなすことができます. さ -て, tcl/tk インタプリタでは, 組み込みコマンドも, 前述のウィジェットと -同じような書式の命令で実行されます. すなわち, コマンドもオブジェクトで -あると考えることができます. +tcl/tk ゃ潟帥帥с, c吾с篏腓冴, c吾с +膓<若帥吾障. c, c吾с吾с +с, 絲障<純c, 帥с障. +, tcl/tk ゃ潟帥帥с, 腟粋昭帥潟潟, 菴違c吾с +後巡擦у茵障. , 潟潟吾с +с障. -このような考えに基づき, tcltk ライブラリでは, tcl/tk のコマンドやウィ -ジェットに対応するオブジェクトを生成します. オブジェクトに対するメソッ -ド呼び出しは, e() メソッドにより実行されます. 例えば, tcl/tk の info -コマンドに対応する ruby のオブジェクトが info という名前であるとすると, -tcl/tk の +冴ャ, tcltk ゃс, tcl/tk 潟潟 +吾с絲上吾с障. 吾с絲障<純 +若喝冴, e() <純絎茵障. 箴, tcl/tk info +潟潟絲上 ruby 吾с info с, +tcl/tk info commands -という命令は tcltk ライブラリでは +巡擦 tcltk ゃс info.e("commands") -と記述されます. また, 「.」というウィジェット (wish 実行時に自動的に生 -成されるルートウィジェット) に対応する ruby のオブジェクトが root とい -う名前であるとすると, +荐菴違障. 障, .c吾с (wish 絎茵 +若c吾с) 絲上 ruby 吾с root +с, . configure -height 300 -width 300 -という tcl/tk の命令は + tcl/tk 巡擦 root.e("configure -height 300 -width 300") -と記述されます. このような記述は, 見ためには美しくありませんが, そして, -スクリプトを読む人には見づらいかも知れませんが, 実際にスクリプトを書い -てみると予想外に手軽です. +荐菴違障. 荐菴違, 荀臂障, , +鴻茯篋冴荀ャャ障, 絎鴻吾 +帥篋喝荵純с. -[使用法] +[篏睡羈] -1. ライブラリを読み込む. +1. ゃ茯粋昭. require "tcltk" -2. tcl/tk インタプリタを生成する. +2. tcl/tk ゃ潟帥帥. ip = TclTkInterpreter.new() -3. tcl/tk のコマンドに対応するオブジェクトを変数に代入しておく. - # コマンドに対応するオブジェクトが入った Hash を取り出す. +3. tcl/tk 潟潟絲上吾с紊違篁eャ. + # 潟潟絲上吾сャc Hash 冴. c = ip.commands() - # 使いたいコマンドに対応するオブジェクトを個別の変数に代入する. + # 篏帥潟潟絲上吾сャ紊違篁eャ. bind, button, info, wm = c.indexes("bind", "button", "info", "wm") -4. 必要な処理を行う. - 詳しくは, サンプルを参照のこと. +4. 綽荀茵. + 荅潟, 泣潟с. -5. 準備ができたら, イベントループに入る. +5. 羣с, ゃ潟若ャ. TclTk.mainloop() -(( 以下, モジュール, クラス等の説明を書く予定.)) +(( 篁ヤ, ≪吾ャ若, 合茯吾鋋絎.)) -<< tcltklib ライブラリ >> +<< tcltklib ゃ >> -tcl/tk の C ライブラリを利用するための低水準インターフェースを提供しま -す. +tcl/tk C ゃ篏羂贋ゃ潟帥若с若鴻箴 +. -コンパイル/実行には, tcl/tk の C ライブラリが必要です. +潟潟ゃ/絎茵, tcl/tk C ゃ綽荀с. -[説明] +[茯] -このライブラリを用いると, ruby から tcl/tk の C ライブラリを利用できま -す. 具体的には, ruby インタプリタから tcl/tk インタプリタを呼び出すこ -とができます. さらに, その(ruby インタプリタから呼び出した) tcl/tk イ -ンタプリタから, 逆に ruby インタプリタを呼び出すこともできます. +ゃ, ruby tcl/tk C ゃс +. 隙, ruby ゃ潟帥帥 tcl/tk ゃ潟帥帥若喝冴 +с障. , (ruby ゃ潟帥帥若喝冴) tcl/tk +潟帥帥, ruby ゃ潟帥帥若喝冴с障. -[使用法] +[篏睡羈] -require "tcltklib" すると, 以下のモジュール, クラスが利用可能です. +require "tcltklib" , 篁ヤ≪吾ャ若, 鴻純с. -モジュール TclTkLib - tcl/tk ライブラリを呼び出すメソッドを集めたモジュールです. ただし, - tcl/tk インタプリタ関係のメソッドはクラス TclTkIp にあります. +≪吾ャ若 TclTkLib + tcl/tk ゃ若喝冴<純≪吾ャ若с. , + tcl/tk ゃ潟帥翠≫<純 TclTkIp 障. - モジュールメソッド mainloop() - Tk_MainLoop を実行します. 全ての tk のウインドウが無くなると終了 - します(例えば, tcl/tk で書くところの "destroy ." をした場合等). - 引数: 無し - 戻り値: nil + ≪吾ャ若<純 mainloop() + Tk_MainLoop 絎茵障. tk ゃ潟<腟篋 + 障(箴, tcl/tk ф吾 "destroy ." 翫膈). + 綣: < + 祉: nil -クラス TclTkIp - インスタンスが tcl/tk のインタプリタに対応します. tcl/tk のライブ - ラリの仕様通り, インスタンスを複数個生成しても正しく動作します(そ - んなことをする必要はあまり無いはずですが). インタプリタは wish の - tcl/tk コマンドを実行できます. さらに, 以下のコマンドを実行できま - す. - コマンド ruby - 引数を ruby で実行します(ruby_eval_string を実行します). 引数 - は 1 つでなければなりません. 戻り値は ruby の実行結果です. - ruby の実行結果は nil か String でなければなりません. + TclTkIp + ゃ潟鴻帥潟鴻 tcl/tk ゃ潟帥帥絲上障. tcl/tk ゃ + 篁罕, ゃ潟鴻帥潟鴻茲医罩c篏障( + 綽荀障<с). ゃ潟帥帥 wish + tcl/tk 潟潟絎茵с障. , 篁ヤ潟潟絎茵с + . + 潟潟 ruby + 綣違 ruby у茵障(ruby_eval_string 絎茵障). 綣 + 1 ゃс違障. 祉ゃ ruby 絎茵腟с. + ruby 絎茵腟 nil String с違障. - クラスメソッド new() - TclTkIp クラスのインスタンスを生成します - 引数: 無し - 戻り値 (TclTkIp): 生成されたインスタンス + 鴻<純 new() + TclTkIp 鴻ゃ潟鴻帥潟鴻障 + 綣: < + 祉 (TclTkIp): ゃ潟鴻帥潟 - メソッド _eval(script) - インタプリタで script を評価します(Tcl_Eval を実行します). 前述 - のように, ruby コマンドにより script 内から ruby スクリプトを実 - 行できます. - 引数: script (String) - インタプリタで評価するスクリプト文字列 - 戻り値 (String): 評価結果 ((Tcl_Interp *)->result) + <純 _eval(script) + ゃ潟帥帥 script 荅箴<障(Tcl_Eval 絎茵障). 菴 + , ruby 潟潟 script ruby 鴻絎 + 茵с障. + 綣: script (String) - ゃ潟帥帥ц箴<鴻絖 + 祉 (String): 荅箴∞ ((Tcl_Interp *)->result) - メソッド _return_value() - 直前の Tcl_Eval の戻り値を返します. 0(TCL_OK) で正常終了です. - 引数: 無し - 戻り値 (Fixnum): 直前の Tcl_Eval() が返した値. + <純 _return_value() + 翫 Tcl_Eval 祉ゃ菴障. 0(TCL_OK) фe幻腟篋с. + 綣: < + 祉 (Fixnum): 翫 Tcl_Eval() 菴. ============================================================== -以下が本ドキュメント作成時点での tcltklib ライブラリの説明です. +篁ヤャ<潟篏鴻с tcltklib ゃ茯с鐚 ============================================================== -モジュール TclTkLib - : 個々の Tcl/Tk インタープリタに依存しない処理 ( == イベントルー - : プに関する処理 ) を呼び出すメソッドを定義したモジュール. - - モジュール TclTkLib::EventFlag - : do_one_event を呼び出す際の処理対象イベントを指定するための - : フラグ ( WINDOW|DONT_WAIT というようにビット演算子で連結して - : 指定 ) を定数として定義したモジュール.以下の定数が含まれる. - - 定数 NONE - : 値は 0 で,値としてはいかなる種類のイベントも指定していない - : ことになるが,実際の処理上は ALL と同じとして扱われる. - - 定数 WINDOW - : window イベントを処理対象とする - - 定数 FILE - : file イベントを処理対象とする - - 定数 TIMER - : timer イベントを処理対象とする - - 定数 IDLE - : アイドルループ処理 ( 再描画など,他の種類のイベントが発生 - : していないときに行われる処理 ) を処理対象とする - - 定数 ALL - : すべての種類のイベントを処理対象とする - : WINDOW|FILE|TIMER|IDLE と同じ - - 定数 DONT_WAIT - : 処理対象イベントが存在しない場合に,イベント発生を待たず - : に do_one_event を終了 ( false を返す ) する - - モジュール TclTkLib::VarAccessFlag - : _get_variable などでのフラグを指定するためのもの.フラグに - : は以下の定数を OR で連結して与える. - - 定数 NONE - : 値は 0 で,何もフラグを指定していないのに等しい. - - 定数 GLOBAL_ONLY - : 通常,変数の検索はまず手続き呼び出しを行ったレベルで検 - : 索し,次に現在の名前空間で検索,最後にグローバル空間で - : 検索を行う.しかし,このフラグが指定された場合には,グ - : ローバル空間でのみ検索する. - : もし GLOBAL_ONLY と NAMESPACE_ONLY とが両方指定された場 - : 合には,GLOBAL_ONLY の指定は無視される. - - 定数 NAMESPACE_ONLY - : このフラグが指定された場合には,現在の名前空間でのみ変 - : 数の検索を行う.GLOBAL_ONLY の説明も参照すること. - - 定数 LEAVE_ERR_MSG - : 変数アクセスにおいてエラーが発生した場合,このフラグが - : 指定されていれば,実行結果として Tcl インタープリタにエ - : ラーメッセージが残される.このフラグが指定されていなけ - : れば,エラーメッセージは一切残されない. - - 定数 APPEND_VALUE - : このフラグが指定されていた場合,変数の値を置き換えので - : はなく,現在の値に代入値が追加 (append; 文字列連結) さ - : れる.変数が未定義あった場合,このフラグは無視される. - - 定数 LIST_ELEMENT - : このフラグが指定されていた場合,代入値はまず Tcl のリス - : ト要素として適切となるように変換される.代入値がリスト - : (またはサブリスト) の最初の要素となるのでない限り,代入 - : 値の直前には空白文字が追加される. - - 定数 PARSE_VARNAME - : _set_variable などの呼び出しにおいてこのフラグが指定さ - : れていた場合,var_name 引数が連想配列名と要素名とを両方 - : 含む可能性がある (開き括弧を含み,閉じ括弧で終わる) こ - : とを示す.その場合,括弧の間が要素名指定,最初の開き括 - : 弧までが連想配列名として扱われる._set_variable2 などで - : このフラグを指定する場合,連想配列名と要素名は var_name - : から抽出されるはずであるから,index_name 引数は nil と - : せねばならない. - - モジュール TclTkLib::RELEASE_TYPE - : Tcl/Tk のリリースタイプ番号の定義 - - 定数 ALPHA - : ALPHA リリース - - 定数 BETA - : BETA リリース - - 定数 FINAL - : FINAL リリース - - モジュールメソッド +≪吾ャ若 TclTkLib + : Tcl/Tk ゃ潟帥若帥箴絖 ( == ゃ潟 + : ≪ ) 若喝冴<純絎臂≪吾ャ若鐚 + + ≪吾ャ若 TclTkLib::EventFlag + : do_one_event 若喝冴絲乗院ゃ潟絎 + : ( WINDOW|DONT_WAIT 羲膊絖чg + : 絎 ) 絎違絎臂≪吾ャ若鐚篁ヤ絎違障鐚 + + 絎 NONE + : ゃ 0 эゃ腮蕁ゃ潟絎 + : 鐚絎筝 ALL 宴鐚 + + 絎 WINDOW + : window ゃ潟絲乗院 + + 絎 FILE + : file ゃ潟絲乗院 + + 絎 TIMER + : timer ゃ潟絲乗院 + + 絎 IDLE + : ≪ゃ若 ( 祉鐚篁腮蕁ゃ潟榊 + : 茵 ) 絲乗院 + + 絎 ALL + : 鴻腮蕁ゃ潟絲乗院 + : WINDOW|FILE|TIMER|IDLE + + 絎 DONT_WAIT + : 絲乗院ゃ潟絖翫鐚ゃ潟榊緇 + : do_one_event 腟篋 ( false 菴 ) + + ≪吾ャ若 TclTkLib::VarAccessFlag + : _get_variable с違絎鐚違 + : 篁ヤ絎違 OR чg筝鐚 + + 絎 NONE + : ゃ 0 э篏違絎膈鐚 + + 絎 GLOBAL_ONLY + : 絽醐紊違罎膣≪障膓若喝冴茵cф + : 膣≪鐚罨<憜腥咲ф膣鐚緇違若腥咲 + : 罎膣≪茵鐚鐚違絎翫鐚 + : 若腥咲с炊膣≪鐚 + : GLOBAL_ONLY NAMESPACE_ONLY 筝≧号絎 + : 鐚GLOBAL_ONLY 絎∴鐚 + + 絎 NAMESPACE_ONLY + : 違絎翫鐚憜腥咲с水 + : 違罎膣≪茵鐚GLOBAL_ONLY 茯с鐚 + + 絎 LEAVE_ERR_MSG + : 紊違≪祉鴻若榊翫鐚違 + : 絎逸絎茵腟 Tcl ゃ潟帥若帥 + : 若<祉若吾罧鐚違絎 + : 逸若<祉若吾筝罧鐚 + + 絎 APPEND_VALUE + : 違絎翫鐚紊違ゃ臀 + : 鐚憜ゃ篁eュゃ菴遵 (append; 絖g) + : 鐚紊違絎臂c翫鐚違∴鐚 + + 絎 LIST_ELEMENT + : 違絎翫鐚篁eュゃ障 Tcl + : 荀膣紊鐚篁eュゃ鴻 + : (障泣鴻) 荀膣с鐚篁e + : ゃ翫腥榊醇絖菴遵鐚 + + 絎 PARSE_VARNAME + : _set_variable 若喝冴違絎 + : 翫鐚var_name 綣違f渇荀膣筝≧ + : 醇с (綣с随綣сх) + : 腓冴鐚翫鐚綣с荀膣絎鐚 + : 綣с障сf渇宴鐚_set_variable2 + : 違絎翫鐚f渇荀膣 var_name + : 遵冴с鐚index_name 綣違 nil + : 違鐚 + + ≪吾ャ若 TclTkLib::RELEASE_TYPE + : Tcl/Tk 若鴻帥ゃ垩絎臂 + + 絎 ALPHA + : ALPHA 若 + + 絎 BETA + : BETA 若 + + 絎 FINAL + : FINAL 若 + + ≪吾ャ若<純 get_version() - : Tcl/Tk の major, minor, release-type 番号, patchlevel を - : 配列にして返す. + : Tcl/Tk major, minor, release-type , patchlevel + : 菴鐚 mainloop(check_root = true) - : イベントループを起動する.check_root が true であれば, - : root widget が存在する限り,このメソッドは終了しない. - : check_root が false の場合は,root widget が消滅しても - : このメソッドは終了しない ( root widget が消滅しても, - : WINDOW 以外のイベントは発生しうるため ).終了には,外部 - : からの働き掛け ( スレッドを活用するなど ) が必要. + : ゃ潟若莎桁鐚check_root true с逸 + : root widget 絖鐚<純腟篋鐚 + : check_root false 翫鐚root widget 羔羯 + : <純腟篋 ( root widget 羔羯鐚 + : WINDOW 篁ュゃ潟榊 )鐚腟篋鐚紊 + : ( 鴻羇紫 ) 綽荀鐚 mainloop_thread? - : カレントスレッドがイベントループを実行しているスレッド - : かどうかを返す. - : イベントループを実行しているスレッドであれば true を, - : どのスレッドでもイベントループが実行されていない場合は - : nil を,他のスレッドでイベントループが実行されている場 - : 合は false を返す. - : false の際に Tk インタープリタを直接呼ぶのは危険である. + : 潟鴻ゃ潟若絎茵鴻 + : 菴鐚 + : ゃ潟若絎茵鴻с true 鐚 + : 鴻сゃ潟若絎茵翫 + : nil 鐚篁鴻сゃ潟若絎茵 + : false 菴鐚 + : false Tk ゃ潟帥若帥贋・若吟演冴с鐚 mainloop_watchdog(check_root = true) - : 通常のイベントループでは,イベント処理の内容によっては - : デッドロックを引き起こす可能性がある (例えばイベントに - : 対するコールバック処理中で widget 操作をし,その終了を - : 待つなど).このメソッドは,そうしたデッドロックを回避す - : るための監視スレッド付きでイベントループを起動する - : ( 監視スレッドを生成した後にイベントループを実行する ). - : 引数の意味は mainloop と同じである. + : 絽吾ゃ潟若с鐚ゃ潟絎鴻c + : 綣莎激醇с (箴違ゃ潟 + : 絲障潟若筝 widget 篏鐚腟篋 + : 緇ゃ)鐚<純鐚帥 + : h鴻篁сゃ潟若莎桁 + : ( h鴻緇ゃ潟若絎茵 )鐚 + : 綣違潟 mainloop с鐚 do_one_event(flag = TclTkLib::EventFlag::ALL | TclTkLib::EventFlag::DONT_WAIT) - : 処理待ちのイベント 1 個を実行する. - : イベントを処理した場合は true を返す. - : フラグで DONT_WAIT を指定していない場合,フラグで処理対 - : 象となっている種類のイベントが発生するまで待ち続ける. - : DONT_WAIT を指定していた場合,処理対象イベントがなくても - : すぐに終了し false を返す. - : $SAFE >= 4 か,$SAFE >= 1 かつ flag が汚染されているならば - : flag には DONT_WAIT が強制的に付けられる. + : 緇<ゃ潟 1 絎茵鐚 + : ゃ潟翫 true 菴鐚 + : 違 DONT_WAIT 絎翫鐚違у絲 + : 莟<c腮蕁ゃ潟榊障у∞鐚 + : DONT_WAIT 絎翫鐚絲乗院ゃ潟 + : 腟篋 false 菴鐚 + : $SAFE >= 4 鐚$SAFE >= 1 flag 羆 + : flag DONT_WAIT 綣桁句篁鐚 set_eventloop_tick(timer_tick) - : イベントループと同時に別スレッドが稼働している場合に,時 - : 間に基づいた強制的なスレッドスイッチングをどの程度の頻度 - : ( 時間間隔 ) で発生させるかをミリ秒単位の整数値で指定する. - : 0 を指定すると,この強制的なスイッチングは行われない. - : 標準では 0 に設定されており,イベント処理数に基づくスイッ - : チングだけが行われる ( see set_eventloop_weight ). - : ただし,稼働しているスレッドがイベントループだけの場合, - : timer_tick を 0 に設定することはできない.もし設定されて - : いたら,100 ms ( see NO_THREAD_INTERRUPT_TIME ) に自動設 - : 定される. - : 詳細な説明は略すが,これは CPU パワーを節約しつつ安全で - : 安定した動作を実現するために実装した仕様である. - : $SAFE >= 4 では実行が禁止される. + : ゃ潟若ャ鴻腮弱翫鐚 + : 冴ャ綣桁句鴻鴻ゃ潟違腮綺糸墾 + : ( ) х榊腱篏贋医ゃф絎鐚 + : 0 絎鐚綣桁句鴻ゃ潟違茵鐚 + : 罔羣с 0 荐絎鐚ゃ潟違冴ャ鴻ゃ + : 潟違茵 ( see set_eventloop_weight )鐚 + : 鐚腮弱鴻ゃ潟若翫鐚 + : timer_tick 0 荐絎с鐚荐絎 + : 鐚100 ms ( see NO_THREAD_INTERRUPT_TIME ) 荐 + : 絎鐚 + : 荅括完茯ャ鐚 CPU 若膀膣ゃゅ + : 絎絎篏絎憗絎茖篁罕с鐚 + : $SAFE >= 4 с絎茵胼罩≪鐚 get_eventloop_tick - : timer_tick の現在値を返す. + : timer_tick 憜ゃ菴鐚 set_no_event_wait(no_event_wait) - : 複数のスレッドが稼働している場合で,処理待ちイベントが全 - : く存在しなかった際に sleep 状態に入る時間長を指定する. - : 稼働スレッドがイベントループだけの場合には意味をなさない. - : デフォルトの値は 20 (ms) - : $SAFE >= 4 では実行が禁止される. + : 茲違鴻腮弱翫э緇<ゃ潟 + : 鎕c sleep 倶ャ激絎鐚 + : 腮弱鴻ゃ潟若翫潟鐚 + : ゃ 20 (ms) + : $SAFE >= 4 с絎茵胼罩≪鐚 get_no_event_wait - : no_event_wait の現在値を返す. + : no_event_wait 憜ゃ菴鐚 set_eventloop_weight(loop_max, no_event_tick) - : 複数のスレッドが稼働している際に Ruby/Tk のイベントルー - : プに割り当てる比重を定めるためのパラメータを設定する. - : 稼働スレッドがイベントループだけの場合には意味をなさない. - : 一度のスレッド切り替えの間に処理するイベントの最大数と, - : 処理待ちのイベントが存在しない際の加算数とを設定する. - : 処理待ちイベントが存在しない場合は no_event_wait ( see - : set_no_event_wait ) だけの間 sleep 状態に入る. - : デフォルトではそれぞれ 800 回と 10 回,つまり,800 個のイ - : ベント (アイドルイベントを含む) を処理するとか,イベント - : が全く発生しないままに 80 回の処理待ちイベント検査が完了 - : するとかでカウントが 800 以上になるとスレッドスイッチング - : が発生することになる. - : $SAFE >= 4 では実行が禁止される. + : 茲違鴻腮弱 Ruby/Tk ゃ潟 + : 蚊綵罸絎<若帥荐絎鐚 + : 腮弱鴻ゃ潟若翫潟鐚 + : 筝綺鴻帥ゃ潟紊ф違鐚 + : 緇<ゃ潟絖膊違荐絎鐚 + : 緇<ゃ潟絖翫 no_event_wait ( see + : set_no_event_wait ) sleep 倶ャ鐚 + : с 800 10 鐚ゃ障鐚800 + : 潟 (≪ゃゃ潟) 鐚ゃ潟 + : 榊障障 80 緇<ゃ潟罎祉絎篋 + : с潟 800 篁ヤ鴻鴻ゃ潟 + : 榊鐚 + : $SAFE >= 4 с絎茵胼罩≪鐚 get_eventloop_weight - : 現在の loop_max と no_event_tick との値を返す. + : 憜 loop_max no_event_tick ゃ菴鐚 : ( see set_eventloop_wait ) mainloop_abort_on_exception=(bool) - : Tk インタープリタ上で例外を発生した際に,イベントループを - : エラー停止させるかどうかを指定する.true を指定した場合は - : エラー停止するが,false の場合は例外を無視してイベントルー - : プを継続する.さらに nil の場合は警告モードでない限りはエ - : ラーメッセージの出力すら省略して,例外を無視する. - : デフォルトでは true に設定されている. - : 1個のインタープリタだけを使っている場合にはエラー時にその - : まま停止しても通常は問題ないが,複数のインタープリタが同時 - : に動作している場合には,それらを管理するイベントループは1 - : 個だけであるため,いずれかのインタープリタのエラーが原因で, - : 他のインタープリタの処理継続が不可能になることがある.その - : ような場合でもエラーを無視してイベントループが稼働を続ける - : ことで,他のインタープリタが正常に動作し続けることができる. - : $SAFE >= 4 では実行が禁止される. + : Tk ゃ潟帥若推т紊榊鐚ゃ潟若 + : 弱罩≪絎鐚true 絎翫 + : 弱罩≪鐚false 翫箴紊∴ゃ潟 + : 膓膓鐚 nil 翫茘≪若с + : 若<祉若吾阪ャ鐚箴紊∴鐚 + : с true 荐絎鐚 + : 鐚ゃ潟帥若帥篏帥c翫惹 + : 障上罩≪絽吾馹鐚茲違ゃ潟帥若帥 + : 篏翫鐚膊∞ゃ潟若鐚 + : с鐚ゃ潟帥若帥若э + : 篁ゃ潟帥若帥膓膓筝純鐚 + : 翫с若∴ゃ潟若腮弱膓 + : э篁ゃ潟帥若帥罩e幻篏膓с鐚 + : $SAFE >= 4 с絎茵胼罩≪鐚 mainloop_abort_on_exception - : Tk インタープリタ上で例外を発生した際に,イベントループをエ - : ラー停止させるかどうかの設定状態を true/false で得る. + : Tk ゃ潟帥若推т紊榊鐚ゃ潟若 + : 弱罩≪荐絎倶 true/false у鐚 num_of_mainwindows - : 現在のメインウィンドウ (ルートウィジェット) の数を返す. - : メインウィンドウは一つのインタープリタに付き最大一つである - : ので,この値は現在 Tk の機能が有効であるインタープリタの総 - : 数に等しい. + : 憜<ゃ潟c潟 (若c吾с) 違菴鐚 + : <ゃ潟c潟筝ゃゃ潟帥若帥篁紊тゃс + : эゃ憜 Tk 罘純鴻сゃ潟帥若帥膩 + : 違膈鐚 _merge_tklist(str, str, ... ) - : Tcl/Tk のライブラリ関数を使って,引数の文字列がそれぞれ - : 正しく一つのリスト要素となるように連結した文字列を返す. + : Tcl/Tk ゃ∽違篏帥c鐚綣違絖 + : 罩c鋇ゃ鴻荀膣g絖菴鐚 _conv_listelement(str) - : Tcl/Tk のライブラリ関数を使って,引数の文字列が Tcl の - : 一つのリスト要素として適切な表現になるように変換した文 - : 字列を返す. + : Tcl/Tk ゃ∽違篏帥c鐚綣違絖 Tcl + : 筝ゃ鴻荀膣茵憗紊 + : 絖菴鐚 _toUTF8(str, encoding=nil) _fromUTF8(str, encoding=nil) - : Tcl/Tk が内蔵している UTF8 変換処理を呼び出す. + : Tcl/Tk 泣 UTF8 紊若喝冴鐚 _subst_UTF_backslash(str) _subst_Tcl_backslash(str) - : Tcl のルールでバックスラッシュ記法 ( \uhhhh による - : Unicode 文字表現を含む ) を解析する. - : _subst_Tcl_backslash はすべてのバックスラッシュ記法を - : 置き換えるのに対し,_subst_UTF_backslash は \uhhhh - : による Unicode 文字表現だけを置き換える. + : Tcl 若с鴻激ヨ羈 ( \uhhhh + : Unicode 絖茵憗 ) 茹f鐚 + : _subst_Tcl_backslash 鴻鴻激ヨ羈 + : 臀絲障鐚_subst_UTF_backslash \uhhhh + : Unicode 絖茵憗臀鐚 encoding_system encoding_system=(encoding) - : Tcl の system encoding の獲得および設定 + : Tcl system encoding 峨活┃絎 encoding encoding=(encoding) - : encoding_system / encoding_system= の alias - : ( Ruby/Tk の tk.rb では置き換えられる予定のもの.) + : encoding_system / encoding_system= alias + : ( Ruby/Tk tk.rb с臀篋絎鐚) -クラス TclTkIp - クラスメソッド + TclTkIp + 鴻<純 new(ip_name=nil, options='') - : TclTkIp クラスのインスタンスを生成する. - : ip_name に文字列を与えた場合は,それが winfo interps などで - : 表示される名前になる. - : options には,-geometry や -use など,wish のコマンドライン - : 引数として与えるオプションと同様の情報を文字列として与える. - : 与えられた情報は,root widget 生成の際に用いられる. + : TclTkIp 鴻ゃ潟鴻帥潟鴻鐚 + : ip_name 絖筝翫鐚 winfo interps + : 茵腓冴鐚 + : options 鐚-geometry -use 鐚wish 潟潟ゃ + : 綣違筝激с潟罕宴絖筝鐚 + : 筝宴鐚root widget 鐚 : ( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') ) - : もし options に敢えて nil または false を与えた場合,Tk ライ - : ブラリが導入されていない (つまりは Tcl のみの) インタープリ - : タを生成する.この場合は GUI 環境は必要ないため,ウインドウ - : システムが存在しない,または使用できない環境でも Tcl インター - : プリタを生成し,Tcl やその拡張ライブラリを活用することができる. + : options ≪ nil 障 false 筝翫鐚Tk + : 絨ャ (ゃ障 Tcl 帥) ゃ潟帥若 + : 帥鐚翫 GUI 医綽荀鐚ゃ潟 + : 激鴻絖鐚障篏睡с医с Tcl ゃ潟帥 + : 帥鐚Tcl ≦宍ゃ羇紫с鐚 - インスタンスメソッド + ゃ潟鴻帥潟鴻<純 create_slave(name, safe=false) - : レシーバを親とする name という名前のスレーブインタープリタを - : 生成する. - : safe には生成するインタープリタを safe インタープリタとする - : かを指定する.デフォルトは false ということになっているが, - : たとえ明確に false を指定していたとしても,親となるインター - : プリタが safe インタープリタであれば,その設定を引き継いで - : safe インタープリタとして生成される. - : $SAFE >= 4 では,safe インタープリタ以外の生成が禁止される. + : 激若荀 name 鴻若ゃ潟帥若帥 + : 鐚 + : safe ゃ潟帥若帥 safe ゃ潟帥若帥 + : 絎鐚 false c鐚 + : 腆冴 false 絎鐚荀ゃ潟帥 + : 帥 safe ゃ潟帥若帥с逸荐絎綣膓 + : safe ゃ潟帥若帥鐚 + : $SAFE >= 4 с鐚safe ゃ潟帥若推札紊胼罩≪鐚 make_safe - : Tcl/Tk インタープリタを safe インタープリタに変更する. - : 戻り値はレシーバであるインタープリタ自身である. - : 失敗した場合は RuntimeError の例外を発生する. + : Tcl/Tk ゃ潟帥若帥 safe ゃ潟帥若帥紊眼鐚 + : 祉ゃ激若сゃ潟帥若粋荳с鐚 + : 紊掩翫 RuntimeError 箴紊榊鐚 safe? - : Tcl/Tk インタープリタが safe インタープリタであるかを調べる. - : safe インタープリタであれば true を返す. + : Tcl/Tk ゃ潟帥若帥 safe ゃ潟帥若帥с茯帥鴻鐚 + : safe ゃ潟帥若帥с true 菴鐚 allow_ruby_exit? - : 対象となるインタープリタ上の評価で,ruby の exit 関数または - : Tcl/Tk 上の exit コマンドによって ruby 自体を終了させること - : を許すかどうかを返す. - : 許さない場合は対象のインタープリタだけが終了する. - : マスターインタープリタのデフォルト値は true,スレーブインター - : プリタのデフォルト値は false である. + : 絲乗院ゃ潟帥若推荅箴<эruby exit ∽違障 + : Tcl/Tk 筝 exit 潟潟c ruby 篏腟篋 + : 荐宴菴鐚 + : 荐宴翫絲乗院ゃ潟帥若帥腟篋鐚 + : 鴻帥若ゃ潟帥若帥ゃ true鐚鴻若ゃ潟帥 + : 帥ゃ false с鐚 allow_ruby_exit=(mode) - : 対象となるインタープリタの allow_ruby_exit? の状態を変更する. - : $SAFE >= 4 またはインタープリタが safe インタープリタの場合は - : 変更が許されない (例外を発生). + : 絲乗院ゃ潟帥若帥 allow_ruby_exit? 倶紊眼鐚 + : $SAFE >= 4 障ゃ潟帥若帥 safe ゃ潟帥若帥翫 + : 紊眼荐宴 (箴紊榊)鐚 delete - : Tcl/Tk インタープリタを delete する. - : delete されたインタープリタは,以後一切の操作ができなくなり, - : コマンドを送っても例外を発生するようになる. + : Tcl/Tk ゃ潟帥若帥 delete 鐚 + : delete ゃ潟帥若帥鐚篁ュ筝篏с鐚 + : 潟潟c箴紊榊鐚 deleted? - : Tcl/Tk インタープリタがすでに delete されているかを調べる. - : delete 済みでコマンドを受け付けない状態になっているならば - : true を返す. + : Tcl/Tk ゃ潟帥若帥с delete 茯帥鴻鐚 + : delete 羝帥с潟潟篁倶c + : true 菴鐚 has_mainwindow? - : Tcl/Tk インタープリタにメインウィンドウ (root widget) が - : 存在すれば true を,存在しなければ false を返す. - : インタープリタが既に delete 済みであれば nil を返す. + : Tcl/Tk ゃ潟帥若帥<ゃ潟c潟 (root widget) + : 絖 true 鐚絖 false 菴鐚 + : ゃ潟帥若帥≪ delete 羝帥с nil 菴鐚 restart - : Tcl/Tk インタープリタの Tk 部分の初期化,再起動を行う. - : 一旦 root widget を破壊した後に再度 Tk の機能が必要と - : なった場合に用いる. - : $SAFE >= 4 では実行が禁止される. + : Tcl/Tk ゃ潟帥若帥 Tk 鐚莎桁茵鐚 + : 筝 root widget 翫緇綺 Tk 罘純綽荀 + : c翫鐚 + : $SAFE >= 4 с絎茵胼罩≪鐚 _eval(str) _invoke(*args) - : Tcl/Tk インタープリタ上で評価を行う. - : _eval は評価スクリプトが一つの文字列であることに対し, - : _invoke は評価スクリプトの token ごとに一つの引数とな - : るように与える. - : _invoke の方は Tcl/Tk インタープリタの字句解析器を用い - : ないため,評価の負荷がより少なくてすむ.ただし,その代 - : わりに auto_load のような機構は働かず,load 等によって - : Tcl/Tk インタープリタ上に既に登録済みのコマンドしか呼 - : び出すことができない. - : _eval では auto_load 機構が働くため,一度 _eval を実行 - : して登録に成功しさえすれば,以降は _invoke でも利用で - : きるようになる. + : Tcl/Tk ゃ潟帥若推ц箴<茵鐚 + : _eval 荅箴<鴻筝ゃ絖с絲障鐚 + : _invoke 荅箴<鴻 token 筝ゃ綣違 + : 筝鐚 + : _invoke 鴻 Tcl/Tk ゃ潟帥若帥絖ヨВ + : 鐚荅箴<莢激絨鐚鐚篁 + : auto_load 罘罕鐚load 膈c + : Tcl/Tk ゃ潟帥若推≪脂我帥潟潟 + : 喝冴с鐚 + : _eval с auto_load 罘罕鐚筝綺 _eval 絎茵 + : 脂蚊逸篁ラ _invoke с + : 鐚 _cancel_eval(str) _cancel_eval_unwind(str) : (Tcl/Tk8.6 or later) - : Tcl_CancelEval() 関数を呼び出し,eval の実行を打ち切る. + : Tcl_CancelEval() ∽違若喝冴鐚eval 絎茵≦鐚 _toUTF8(str, encoding=nil) _fromUTF8(str, encoding=nil) - : Tcl/Tk が内蔵している UTF8 変換処理を呼び出す. + : Tcl/Tk 泣 UTF8 紊若喝冴鐚 _thread_vwait(var_name) _thread_tkwait(mode, target) - : スレッド対応の vwait あるいは tkwait 相当のメソッド. - : 通常の vwait あるいは tkwait コマンドと異なるのは,イベン - : トループとは異なるスレッドから呼び出した場合に vwait 等の - : スタックとは独立に条件の成立待ちがなされることである. - : 通常の vwait / tkwait では,vwait / tkwait (1) の待ちの途 - : 中でさらに vwait / tkwait (2) が呼ばれた場合,待ちの対象 - : となっている条件の成立順序がどうあれ,(2)->(1) の順で待ち - : を終了して戻ってくる. - : _thread_vwait / _thread_tkwait は,イベントループのスレッ - : ドで呼ばれた場合は通常の vwait / tkwait と同様に動作する - : が,イベントループ以外のスレッドで呼ばれた場合にはそのス - : レッドを停止させて待ちに入り,条件が成立した時にスレッド - : の実行を再開する.「vwait 等の待ちスタックとは独立」とい - : う意味は,この再開のタイミングが他のスレッドでの待ち状況 - : とは無関係ということである.つまり,イベントループ等の他 - : のスレッドで vwait 等で待ちの状態にあったとしてもその完了 - : を待つことなく,自らの待ち条件が成立次第,処理を継続する - : ことになる. + : 鴻絲上 vwait tkwait 後<純鐚 + : 絽吾 vwait tkwait 潟潟違鐚ゃ + : 若違鴻若喝冴翫 vwait 膈 + : 鴻帥腴>散腴緇<с鐚 + : 絽吾 vwait / tkwait с鐚vwait / tkwait (1) 緇< + : 筝с vwait / tkwait (2) 若違翫鐚緇<絲乗院 + : c>散腴綺鐚(2)->(1) у + : 腟篋祉c鐚 + : _thread_vwait / _thread_tkwait 鐚ゃ潟若鴻 + : у若違翫絽吾 vwait / tkwait 罕篏 + : 鐚ゃ潟若篁ュ鴻у若違翫 + : 罩≪緇<ャ鐚>散腴鴻 + : 絎茵鐚vwait 膈緇<鴻帥腴 + : 潟鐚帥ゃ潟違篁鴻с緇∞倶 + : ♂≫с鐚ゃ障鐚ゃ潟若膈篁 + : 鴻 vwait 膈у<倶c絎篋 + : 緇ゃ鐚緇≧>散腴罨∞鐚膓膓 + : 鐚 _return_value - : 直前の Tcl/Tk 上での評価の実行結果としての戻り値を返す. + : 翫 Tcl/Tk 筝с荅箴<絎茵腟祉ゃ菴鐚 _get_variable(var_name, flag) _get_variable2(var_name, index_name, flag) - : Tcl/Tk 上の var という変数名の変数の値を返す. - : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照) - : された場合は連想配列 var_name の index_name の要素を返す. - : flag には変数を検索する際の条件を指定する.flag に与える - : 値はモジュール TclTkLib::VarAccessFlag を参照すること. + : Tcl/Tk 筝 var 紊医紊違ゃ菴鐚 + : index_name 絎 (PARSE_VARNAME 違茯) + : 翫f渇 var_name index_name 荀膣菴鐚 + : flag 紊違罎膣≪>散絎鐚flag 筝 + : ゃ≪吾ャ若 TclTkLib::VarAccessFlag с鐚 _set_variable(var_name, value, flag) _set_variable2(var_name, index_name, value, flag) - : Tcl/Tk 上の var という変数名の変数に値を設定する. - : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照) - : された場合は連想配列 var_name の index_name の要素を設定 - : する. - : flag には変数を検索する際の条件を指定する.flag に与える - : 値はモジュール TclTkLib::VarAccessFlag を参照すること. + : Tcl/Tk 筝 var 紊医紊違ゃ荐絎鐚 + : index_name 絎 (PARSE_VARNAME 違茯) + : 翫f渇 var_name index_name 荀膣荐絎 + : 鐚 + : flag 紊違罎膣≪>散絎鐚flag 筝 + : ゃ≪吾ャ若 TclTkLib::VarAccessFlag с鐚 _unset_variable(var_name) _unset_variable2(var_name, index_name) - : Tcl/Tk 上の var_name という変数名の変数を消去する. - : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照) - : された場合は連想配列 var_name から index_name の要素だけ - : を消去する. + : Tcl/Tk 筝 var_name 紊医紊違羔サ鐚 + : index_name 絎 (PARSE_VARNAME 違茯) + : 翫f渇 var_name index_name 荀膣 + : 羔サ鐚 _get_global_var(var_name) _get_global_var2(var_name, index_name) @@ -527,31 +527,31 @@ require "tcltklib" _set_global_var2(var_name, index_name, value) _unset_global_var(var_name) _unset_global_var2(var_name, index_name) - : それぞれ,対応する変数アクセスメソッドの flag に対して - : (GLOBAL_ONLY | LEAVE_ERR_MSG) を与えたもの. + : 鐚絲上紊違≪祉鴻<純 flag 絲障 + : (GLOBAL_ONLY | LEAVE_ERR_MSG) 筝鐚 _split_tklist(str) - : Tcl/Tk のライブラリ関数を使って,文字列 str をリストに - : 分割する (文字列の配列として返す). + : Tcl/Tk ゃ∽違篏帥c鐚絖 str 鴻 + : 蚊 (絖菴)鐚 _merge_tklist(str, str, ... ) - : Tcl/Tk のライブラリ関数を使って,引数の文字列がそれぞれ - : 正しく一つのリスト要素となるように連結した文字列を返す. + : Tcl/Tk ゃ∽違篏帥c鐚綣違絖 + : 罩c鋇ゃ鴻荀膣g絖菴鐚 _conv_listelement(str) - : Tcl/Tk のライブラリ関数を使って,引数の文字列が Tcl の - : 一つのリスト要素として適切な表現になるように変換した文 - : 字列を返す. + : Tcl/Tk ゃ∽違篏帥c鐚綣違絖 Tcl + : 筝ゃ鴻荀膣茵憗紊 + : 絖菴鐚 mainloop mainloop_watchdog - : スレーブ IP の場合にはイベントループを起動せずに nil を返す. - : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ. + : 鴻若 IP 翫ゃ潟若莎桁 nil 菴鐚 + : 篁ュ鴻с綣違 TclTkLib <純鐚 do_one_event - : スレーブ IP の場合には引数のイベントフラグに DONT_WAIT が - : 強制的に追加される (イベント待ちでスリープすることは禁止). - : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ. + : 鴻若 IP 翫綣違ゃ潟違 DONT_WAIT + : 綣桁句菴遵 (ゃ潟緇<с鴻若胼罩)鐚 + : 篁ュ鴻с綣違 TclTkLib <純鐚 set_eventloop_tick get_eventloop_tick @@ -561,24 +561,24 @@ require "tcltklib" get_eventloop_weight mainloop_abort_on_exception mainloop_abort_on_exception= - : スレーブ IP の場合には値の設定が許されない (無視される). - : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ. + : 鴻若 IP 翫ゃ荐絎荐宴 (∴)鐚 + : 篁ュ鴻с綣違 TclTkLib <純鐚 encoding_table - : Ruby m17n 用に Ruby と Tk との間の encoding 対応表を返す. - -クラス TkCallbackBreak < StandardError -クラス TkCallbackContinue < StandardError - : これらはイベントコールバックにおいて,コールバック処理を適切に中 - : 断したり,次のバインドタグのバインディング処理に進めたりすること - : を可能にするための例外クラスである. - : コールバックで break や continue を実現するためには,コールバック - : である Ruby 手続きが Tcl/Tk インタープリタ側に適切なリターンコー - : ドを返す必要がある.Ruby の手続きが普通に値を返すのでは,それが普 - : 通の戻り値であるのか否かを区別ができないため,例外発生を利用した - : 実装を行っている. - : ただし現在では,コールバック手続きを Ruby の break, next で終了す - : ることで同等の結果を得ることができるようになっている.それゆえ, - : これらは必要ないものではあるが,互換性のために残してある. + : Ruby m17n Ruby Tk encoding 絲上茵菴鐚 + + TkCallbackBreak < StandardError + TkCallbackContinue < StandardError + : ゃ潟潟若鐚潟若筝 + : 鐚罨<ゃ潟帥違ゃ潟c潟医蚊 + : 純箴紊鴻с鐚 + : 潟若 break continue 絎憗鐚潟若 + : с Ruby 膓 Tcl/Tk ゃ潟帥若水眼帥若潟潟 + : 菴綽荀鐚Ruby 膓ゃ菴с鐚 + : 祉ゃс阪ャс鐚箴紊榊 + : 絎茖茵c鐚 + : 憜с鐚潟若膓 Ruby break, next х篋 + : у膈腟緇сc鐚鐚 + : 綽荀с鐚篋с罧鐚 (eof) diff --git a/ext/tk/README.1st b/ext/tk/README.1st index 0179f4d526..96564cc67b 100644 --- a/ext/tk/README.1st +++ b/ext/tk/README.1st @@ -6,14 +6,14 @@ work without Tcl/Tk libraries (e.g. libtcl8.4.so) on your environment. You must also check that your Tcl/Tk is installed properly. -------------------------------------------- - ( the following is written in EUC-JP ) + ( the following is written in UTF-8 ) -Ruby/Tk (tk.rb など) を使いたい場合には,tcltklib.so が正しく動いていな -ければなりません.コンパイル時に何か問題が生じた場合は,README.tcltklib -や README.ActiveTcl を見てください. -たとえ Ruby のライブラリディレクトリに tcltklib.so が存在していたとして -も,実行環境に Tcl/Tk ライブラリ (libtcl8.4.so など) がなければ機能しま -せん.Tcl/Tk が正しくインストールされているかもチェックしてください. +Ruby/Tk (tk.rb ) 篏帥翫鐚tcltklib.so 罩c +違障鐚潟潟ゃ篏馹翫鐚README.tcltklib + README.ActiveTcl 荀鐚 + Ruby ゃc tcltklib.so 絖 +鐚絎茵医 Tcl/Tk ゃ (libtcl8.4.so ) 井純 +鐚Tcl/Tk 罩cゃ潟鴻若с鐚 ========================================================== Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) diff --git a/ext/tk/lib/tcltk.rb b/ext/tk/lib/tcltk.rb index 2df3b2fd8c..48ec1df09a 100644 --- a/ext/tk/lib/tcltk.rb +++ b/ext/tk/lib/tcltk.rb @@ -280,7 +280,7 @@ class TclTkWidget < TclTkCommand # interp: interpreter(TclTkInterpreter) # parent: parent widget - # command: widget generating tk command(label 等) + # command: widget generating tk command(label 膈) # *args: argument to the command interp, parent, command, *args = args diff --git a/ext/tk/old-README.tcltklib.eucj b/ext/tk/old-README.tcltklib.eucj index 1683629fcb..e29b389402 100644 --- a/ext/tk/old-README.tcltklib.eucj +++ b/ext/tk/old-README.tcltklib.eucj @@ -1,159 +1,159 @@ (tof) 2003/06/19 Hidetoshi NAGAI -本ドキュメントには古い tcltk ライブラリ,tcltklib ライブラリの説明 -が含まれていますが,その記述内容は古いものとなっています. +ャ<潟ゃ tcltk ゃ鐚tcltklib ゃ茯 +障障鐚荐菴医絎鴻ゃc障鐚 -まず,現在の Ruby/Tk の中心である tk.rb は wish を呼び出したりはせ -ず,tcltklib ライブラリを wrap して動作するものとなっています.その -ため,古い説明記述で述べられているようなプロセス間通信によるオーバ -ヘッドは存在しません. +障鐚憜 Ruby/Tk 筝綽с tk.rb wish 若喝冴 +鐚tcltklib ゃ wrap 篏c障鐚 +鐚ゃ茯荐菴違ц唇鴻祉拷篆<若 +絖障鐚 -現在の tcltklib ライブラリでも,Tcl/Tk の C ライブラリをリンクして -直接に動かすことで,オーバヘッドを押さえつつ Tcl/Tk インタープリタ -のほぼ全機能(拡張ライブラリを含む)を使える点は同じです.しかし, -その役割はほぼ「tk.rb 以下のライブラリを効果的に働かせるためのもの」 -と見なされており,その目的でメンテナンスされています. +憜 tcltklib ゃс鐚Tcl/Tk C ゃ潟 +贋・э若若ゃ Tcl/Tk ゃ潟帥若 +祉弱罘緒≦宍ゃ鐚篏帥鴻с鐚鐚 +綵劫蚊祉若tk.rb 篁ヤゃ号 +荀鐚с<潟潟鴻障鐚 -tk.rb の高機能化に伴って,中水準のライブラリである tcltk ライブラリ -(tcltk.rb)はその存在意義を減じており,現在ではメンテナンスは行わ -れていません. +tk.rb 蕭罘遵篌眼c鐚筝羂贋ゃс tcltk ゃ +鐚tcltk.rb鐚絖靸羝鐚憜с<潟潟鴻茵 +障鐚 -なお,古い説明ではバインディングにおけるスクリプトの追加はできないこ -ととなっていますが,現在の tk.rb ではこれも可能であることを補足して -おきます. +鐚ゃ茯сゃ潟c潟違鴻菴遵с +c障鐚憜 tk.rb с純с茖莇潟 +障鐚 -以下がライブラリの古い説明文書です. +篁ヤゃゃ茯吾с鐚 ============================================================== - tcltk ライブラリ - tcltklib ライブラリ + tcltk ゃ + tcltklib ゃ Sep. 19, 1997 Y. Shigehiro -以下, 「tcl/tk」という表記は, tclsh や wish を実現している, 一般でいう -ところの tcl/tk を指します. 「tcltk ライブラリ」, 「tcltklib ライブラ -リ」という表記は, 本パッケージに含まれる ruby 用のライブラリを指します. +篁ヤ, tcl/tk茵荐, tclsh wish 絎憗, 筝с + tcl/tk 障. tcltk ゃ, tcltklib ゃ +茵荐, 宴若吾障 ruby ゃ障. -[ファイルについて] +[<ゃゃ] -README.euc : このファイル(注意, 特徴, インストールの方法). -MANUAL.euc : マニュアル. +README.euc : <ゃ(羈, 劫彰, ゃ潟鴻若号). +MANUAL.euc : ャ≪. -lib/, ext/ : ライブラリの実体. +lib/, ext/ : ゃ絎篏. -sample/ : マニュアル代わりのサンプルプログラム. -sample/sample0.rb : tcltklib ライブラリのテスト. -sample/sample1.rb : tcltk ライブラリのテスト. - tcl/tk (wish) でできそうなことを一通り書いてみました. -sample/sample2.rb : tcltk ライブラリのサンプル. - maeda shugo (shugo@po.aianet.ne.jp) 氏による - (`rb.tk' で書かれていた) ruby のサンプルプログラム +sample/ : ャ≪篁c泣潟違. +sample/sample0.rb : tcltklib ゃ鴻. +sample/sample1.rb : tcltk ゃ鴻. + tcl/tk (wish) сс筝吾帥障. +sample/sample2.rb : tcltk ゃ泣潟. + maeda shugo (shugo@po.aianet.ne.jp) 羂 + (`rb.tk' ф吾) ruby 泣潟違 http://www.aianet.or.jp/~shugo/ruby/othello.rb.gz - を tcltk ライブラリを使うように, 機械的に変更してみました. + tcltk ゃ篏帥, 罘罌亥紊眼帥障. -demo/ : 100 本の線を 100 回描くデモプログラム. - 最初に空ループの時間を測定し, 続いて実際に線を引く時間を測定します. - tcl/tk は(再)描画のときに backing store を使わずに律義に 10000 本(?) - 線を引くので, (再)描画を始めると, マシンがかなり重くなります. -demo/lines0.tcl : wish 用のスクリプト. -demo/lines1.rb : `tk.rb' 用のスクリプト. -demo/lines2.rb : tcltk ライブラリ用のスクリプト. +demo/ : 100 膩 100 ≪違. + 腥冴若羝絎, 膓絎膩綣羝絎障. + tcl/tk ()祉 backing store 篏帥緇臂 10000 (?) + 膩綣, ()祉紮, 激潟障. +demo/lines0.tcl : wish 鴻. +demo/lines1.rb : `tk.rb' 鴻. +demo/lines2.rb : tcltk ゃ鴻. -[注意] +[羈] -コンパイル/実行には, tcl/tk の C ライブラリが必要です. +潟潟ゃ/絎茵, tcl/tk C ゃ綽荀с. -このライブラリは, +ゃ, ruby-1.0-970701, ruby-1.0-970911, ruby-1.0-970919 FreeBSD 2.2.2-RELEASE - およびそのパッケージ jp-tcl-7.6.tgz, jp-tk-4.2.tgz + 潟宴若 jp-tcl-7.6.tgz, jp-tk-4.2.tgz -で作成/動作確認しました. 他の環境では動作するかどうかわかりません. +т/篏腆肴障. 篁医с篏障. -TclTkLib.mainloop を実行中に Control-C が効かないのは不便なので, ruby -のソースを参考に, #include "sig.h" して trap_immediate を操作していま -すが, ruby の README.EXT にも書いてないのに, こんなことをして良いのか -どうかわかりません. +TclTkLib.mainloop 絎茵筝 Control-C 鴻筝箴帥, ruby +純若鴻, #include "sig.h" trap_immediate 篏 +, ruby README.EXT 吾, +障. --d オプションでデバッグ情報を表示させるために, ruby のソースを参考に, -debug という大域変数を参照していますが, ruby の README.EXT にも書いて -ないのに, こんなことをして良いのかどうかわかりません. +-d 激с潟с井宴茵腓冴, ruby 純若鴻, +debug 紊у紊違с障, ruby README.EXT 吾 +, 障. -extconf.rb は書きましたが, (いろいろな意味で)これで良いのか良く分かり -ません. +extconf.rb 吾障, (潟)ц +障. -[特徴] +[劫彰] -ruby から tcl/tk ライブラリを利用できます. +ruby tcl/tk ゃс障. -tcl/tk インタプリタのスクリプトは, 機械的に tcltk ライブラリ用の ruby -スクリプトに変換できます. +tcl/tk ゃ潟帥帥鴻, 罘罌亥 tcltk ゃ ruby +鴻紊с障. -(`tk.rb' との違い) +(`tk.rb' ) -1. tcl/tk インタプリタのスクリプトが, どのように, tcltk ライブラリ用の - ruby スクリプトに変換されるかが理解できれば, マニュアル類が無いに等 - しい `tk.rb' とは異なり +1. tcl/tk ゃ潟帥帥鴻, , tcltk ゃ + ruby 鴻紊茹cс, ャ≪蕁<膈 + `tk.rb' 違 - tcl/tk のマニュアルやオンラインドキュメントを用いて + tcl/tk ャ≪潟ゃ潟ャ<潟 - 効率良くプログラミングを行うことができます. - 記述方法がわからない, コマンドに与えるパラメータがわからない... - - Canvas.new { ... } と, なぜイテレータブロックを書けるの?? - - Canvas の bbox は数値のリストを返すのに, xview は文字列を返すの?? - と, いちいち, ライブラリのソースを追いかける必要はありません. + 合違潟違茵с障. + 荐菴井号, 潟潟筝<若帥... + - Canvas.new { ... } , ゃ若帥吾?? + - Canvas bbox 医ゃ鴻菴, xview 絖菴?? + , <, ゃ純若鴻菴純綽荀障. -2. 個々の機能(オプション)を個別処理によりサポートしており, そのためサ - ポートしていない機能は使うことができない(本当は使えないこともないの - ですが) `tk.rb' とは異なり, tcl/tk インタプリタで可能なことは +2. 罘(激с)ュ泣若, + 若罘純篏帥с(綵篏帥 + с) `tk.rb' 違, tcl/tk ゃ潟帥帥у純 - ほとんど + 祉 - ruby からも実行できます. 現在, ruby から実行できないことが確認され - ているのは, + ruby 絎茵с障. 憜, ruby 絎茵с腆肴 + , - bind コマンドでスクリプトを追加する構文 - 「bind tag sequence +script」 + bind 潟潟с鴻菴遵罕 + bind tag sequence +script ^ - のみです. - - `. configure -width' をしようとして, `Tk.root.height()' と書い - たのに, `undefined method `height'' と怒られてしまった. tk.rb を - 読んでみて, ガーン. できないのか... - ということはありません. + 帥с. + - `. configure -width' , `Tk.root.height()' 吾 + , `undefined method `height'' 障c. tk.rb + 茯с帥, 若. с... + 障. -3. wish プロセスを起動しプロセス間通信で wish を利用する `tk.rb' とは - 異なり, tcl/tk の C ライブラリをリンクし +3. wish 祉鴻莎桁祉拷篆< wish `tk.rb' + 違, tcl/tk C ゃ潟 - より高速に (といっても, 思った程は速くないですが) + 蕭 (c, c腮с) - 処理を行います. + 茵障. -4. `tk.rb' ほど, 高水準なインターフェースを備えていないため, tcl/tk イ - ンタプリタの生成等 +4. `tk.rb' 祉, 蕭羂贋ゃ潟帥若с若鴻, tcl/tk + 潟帥帥膈 - 何から何まで自分で記述 + 篏篏障цц菴 - しなければなりません(その代わり, tcl/tk ライブラリの仕様通り, - tcl/tk インタプリタを複数生成することもできますが). - インターフェースは(おそらく) ruby の思想に沿ったものではありません. - また, スクリプトの記述は + 違障(篁c, tcl/tk ゃ篁罕, + tcl/tk ゃ潟帥帥茲亥с障). + ゃ潟帥若с若鴻() ruby 潟羃帥cс障. + 障, 鴻荐菴違 - ダサダサ + 泣 - です. スクリプトは, 一見, 読みづらいものとなります. が, 書く人にとっ - ては, それほど煩わしいものではないと思います. + с. 鴻, 筝荀, 茯帥ャ障. , 吾鋋冴 + , 祉с障. -[インストールの方法] +[ゃ潟鴻若号] -0. ruby のソースファイル(ruby-1.0-なんたら.tgz)を展開しておきます. +0. ruby 純若鴻<ゃ(ruby-1.0-.tgz)絮障. -1. ruby-1.0-なんたら/ext に ext/tcltklib をコピーします. - cp -r ext/tcltklib ???/ruby-1.0-なんたら/ext/ +1. ruby-1.0-/ext ext/tcltklib 潟若障. + cp -r ext/tcltklib ???/ruby-1.0-/ext/ -2. ruby のインストール法に従い make 等をします. +2. ruby ゃ潟鴻若羈緇 make 膈障. -3. ruby のライブラリ置場に lib/* をコピーします. +3. ruby ゃ臀眼 lib/* 潟若障. cp lib/* /usr/local/lib/ruby/ (eof) diff --git a/ext/tk/sample/demos-en/README b/ext/tk/sample/demos-en/README index a6ea4fae8c..033dca33c6 100644 --- a/ext/tk/sample/demos-en/README +++ b/ext/tk/sample/demos-en/README @@ -68,71 +68,71 @@ Notes: Ruby/Tk81 widget-demo 1999/08/13 - 北陸先端大情報科学研究科 - 立石 + 後腴紊ф援絖腥句 + 腴 -Tcl/Tk8.1ではunicode(UTF8)が採用され、unicodeに変換された日本語であれば -Widgetに表示させることが可能です。本アーカイブには以前に永井さんが中心と -なられて作成されたRuby/Tkのサンプルに修正を加え、以下の環境においてで動作 -を確認したものです。 +Tcl/Tk8.1сunicode(UTF8)。unicode紊ユ茯с +Widget茵腓冴純с≪若ゃ篁ュ羂娯筝綽 +篏Ruby/Tk泣潟篆罩c篁ヤ医у篏 +腆肴с * ruby-1.3.7,ruby-1.4.0 * tcl8.1, tk8.1 * linux-2.2 -Windows(Cygwin)において、サンプルを動かすにはrubyを-Keというオプションを付 -けて起動させると良いそうです。 - 情報提供:渡辺さん +Windows(Cygwin)泣潟ruby-Ke激с潟篁 +莎桁с + 掩箴鐚羝∴昇 ---------------------------------------------------------------------------- Ruby/Tk widget-demo version 1.1 ( 1998/07/24 ) - 永井@知能.九工大 (nagai@ai.kyutech.ac.jp) - -標準配布の Tcl/Tk 拡張パッケージを取り込んだ Ruby (以下 Ruby/Tk と呼びます) -では,Tk widget を用いた GUI の作成を行うことができます.実際に GUI を作成 -していく場合には様々な実例がサンプルとして存在すると便利なのですが,Ruby/Tk -にはそのような適当なサンプルスクリプト集合は存在しませんでした.それに対し, -拡張パッケージの元である Tcl/Tk には,Tk widget を用いてどのようなことがで -きるかを示すものとして widget-demo が存在しおり,Tcl/Tk を用いた GUI の作成 -を習得する際の代表的サンプルとなっています.本アーカイブは,Ruby/Tk の習得の -ための代表的なサンプルスクリプトとすべく,Tcl/Tk の widget-demo を移植したも -のです. - -本アーカイブに含まれるスクリプトを実行するためには,ruby-1.1c2 以上であるこ -とが必要です.1.1c1 の場合は,本アーカイブに含まれる patck_1.1c1 を Ruby の -ライブラリにあててください.組み込む Tk のバージョンは,4.2 でも 8.0 でも修 -正なく動かせるはずです.ただし,日本語版での移植となっているため,日本語化さ -れた Tk をご利用ください.スクリプトのテストは,Tk4.2jp と Tk8.0jp の上で行 -いました (完璧にではないですが). - -本アーカイブに含まれるスクリプトの多くは,元となっている Tcl/Tk 版に比較的近 -いスクリプト記述となるようにしています.そのため,Ruby/Tk のサンプルと言うに -は,あまり Ruby らしくないとも言えるでしょう.にもかかわらず,そのような記述 -を取っている理由は,Ruby/Tk のドキュメント不足にあります. - -Tcl/Tk には適当な参考書が何冊か存在していますから,Ruby/Tk スクリプトを作成 -する際は,そのような Tcl/Tk の参考書で情報を補いながら作成することになると思 -います.各 widget の使用例として,Tcl/Tk の widget-demo を参照することもある -でしょう.Ruby/Tk 版の記述を widget-demo を Tcl/Tk 版の記述に近いものにして -おけば,その対比によって,Ruby/Tk の理解を早めることができると考えられます. -一旦 Ruby/Tk での 各 widget の使用方法を習得してしまえば,Ruby らしいスクリ -プトを作成することは難しくないでしょう.本アーカイブのスクリプトは,Ruby/Tk -を最初に習得するまでの踏台として利用していただければ幸いです. - -widget-demo の移植にあたっては,次の方にも移植したスクリプトを提供していただ -きました.ここに感謝の意を表します. - - 立石@JAIST (ttate@jaist.ac.jp) さん - 平松祥史 (hiramatu@cdrom.co.jp) さん - -平松さんによる Ruby/Tk 入門の Web page (http://www.cdrom.co.jp/~hiramatu/) -も Ruby/Tk の習得に有用と思えますので,ぜひご参照ください. - -また,前橋 (maebashi@iij.ad.jp) さんをはじめとして,widget-demo の移植に際し -て必要となった Ruby の Tk 関連ライブラリ修正について,問題点,バグの指摘をし -ていただいた方々にも感謝致します. - -そして最後に最大の感謝を Ruby 設計者の まつもと ゆきひろ (matz@netlab.co.jp) -さんに捧げたいと思います. + 羂娯鐚ヨ緒箙綏ュぇ (nagai@ai.kyutech.ac.jp) + +罔羣絽 Tcl/Tk ≦宍宴若吾莨若 Ruby (篁ヤ Ruby/Tk 若潟障) +с鐚Tk widget GUI 篏茵с障鐚絎 GUI 篏 +翫罕絎箴泣潟絖箴水с鐚Ruby/Tk +綵泣潟鴻絖障с鐚絲障鐚 +≦宍宴若吾с Tcl/Tk 鐚Tk widget +腓冴 widget-demo 絖鐚Tcl/Tk GUI 篏 +膺緇篁h;泣潟c障鐚≪若ゃ鐚Ruby/Tk 膺緇 +篁h;泣潟鴻鴻鐚Tcl/Tk widget-demo 腱紙 +с鐚 + +≪若ゃ障鴻絎茵鐚ruby-1.1c2 篁ヤс +綽荀с鐚1.1c1 翫鐚≪若ゃ障 patck_1.1c1 Ruby +ゃ鐚腟粋昭 Tk 若吾с潟鐚4.2 с 8.0 с篆 +罩cс鐚鐚ユ茯с腱紙c鐚ユ茯 + Tk 鐚鴻鴻鐚Tk4.2jp Tk8.0jp 筝ц +障 (絎ссс)鐚 + +≪若ゃ障鴻紊鐚c Tcl/Tk 罸莠菴 +鴻荐菴違障鐚鐚Ruby/Tk 泣潟荐 +鐚障 Ruby 荐с鐚鐚荐菴 +c宴鐚Ruby/Tk ャ<潟筝莇潟障鐚 + +Tcl/Tk 綵吾篏絖障鐚Ruby/Tk 鴻篏 +鐚 Tcl/Tk 吾ф宴茖篏 +障鐚 widget 篏睡箴鐚Tcl/Tk widget-demo с +с鐚Ruby/Tk 荐菴違 widget-demo Tcl/Tk 荐菴違菴 +逸絲丈c鐚Ruby/Tk 茹cс障鐚 +筝 Ruby/Tk с widget 篏睡号膺緇障逸Ruby 鴻 +篏cс鐚≪若ゃ鴻鐚Ruby/Tk +膺緇障с荼伹医晃с鐚 + +widget-demo 腱紙c鐚罨<鴻腱紙鴻箴 +障鐚茗茵障鐚 + + 腴鰹JAIST (ttate@jaist.ac.jp) + 綛恰丞ゥ (hiramatu@cdrom.co.jp) + +綛恰障 Ruby/Tk ラ Web page (http://www.cdrom.co.jp/~hiramatu/) + Ruby/Tk 膺緇障э蚊с鐚 + +障鐚罘 (maebashi@iij.ad.jp) 鐚widget-demo 腱紙 +綽荀c Ruby Tk ∫cゃ篆罩cゃ鐚馹刻違 +鴻茗眼障鐚 + +緇紊с茗 Ruby 荐荐 障ゃ 蚊 (matz@netlab.co.jp) +с障鐚 diff --git a/ext/tk/sample/demos-en/README.tkencoding b/ext/tk/sample/demos-en/README.tkencoding index 679b476a08..cca8734a28 100644 --- a/ext/tk/sample/demos-en/README.tkencoding +++ b/ext/tk/sample/demos-en/README.tkencoding @@ -3,27 +3,27 @@ The library 'tkencoding.rb' is obsolete. Functions of tkencoding.rb is already included into Ruby/Tk. ------------------------------------------------- -tkencoding.rbを用いた日本語の表示について +tkencoding.rbユ茯茵腓冴ゃ Copyright (C) 1999/07, Takaaki Tateishi -1. tkencoding.rbとは? +1. tkencoding.rb鐚 -tkencoding.rbはTcl/Tk8.1を利用したRuby/Tkのためのライブラリ -です。tkencoding.rbをrequireすることによってWedgetに表示さ -れるテキストは全てunicode(UTF8)へ変換されます。 +tkencoding.rbTcl/Tk8.1Ruby/Tkゃ +сtkencoding.rbrequirecWedget茵腓冴 +鴻unicode(UTF8)後障 -2. 使い方 +2. 篏帥 -tkencoding.rbをrequireしてTk.encodingで使用している文字コード -を指定して下さい。例えば以下のような感じになります。 +tkencoding.rbrequireTk.encodingт戎絖潟若 +絎筝箴遺札筝障 ---- require 'tk' require 'tkencoding' -Tk.encoding = "euc-jp" +Tk.encoding = "utf-8" # Tk.encoding = "shiftjis" --- diff --git a/ext/tk/sample/demos-jp/README b/ext/tk/sample/demos-jp/README index 6375800232..4278124659 100644 --- a/ext/tk/sample/demos-jp/README +++ b/ext/tk/sample/demos-jp/README @@ -1,54 +1,54 @@ Ruby/Tk widget-demo version 1.2 ( 2000/04/08 ) - 永井@知能.九工大 (nagai@ai.kyutech.ac.jp) - -標準配布の Tcl/Tk 拡張パッケージを取り込んだ Ruby (以下 Ruby/Tk と呼びます) -では,Tk widget を用いた GUI の作成を行うことができます.実際に GUI を作成 -していく場合には様々な実例がサンプルとして存在すると便利なのですが,Ruby/Tk -にはそのような適当なサンプルスクリプト集合は存在しませんでした.それに対し, -拡張パッケージの元である Tcl/Tk には,Tk widget を用いてどのようなことがで -きるかを示すものとして widget-demo が存在しおり,Tcl/Tk を用いた GUI の作成 -を習得する際の代表的サンプルとなっています.本アーカイブは,Ruby/Tk の習得の -ための代表的なサンプルスクリプトとすべく,Tcl/Tk の widget-demo を移植したも -のです. - -今回のバージョンは ruby-1.4.x に対応としておきますが,旧バージョンに比べて, -ほとんど変更はありません.ruby-1.1c2 以上なら動くと思います.ruby-1.5.x につ -いてはテストしていません.そのため,非互換の影響が出ることがあるかもしれませ -んが,その場合でも少しの修正で動かせると思います.組み込む Tk のバージョンは, -4.2 でも 8.0 でも修正なく動かせるはずです.ただし,日本語版での移植となって -いるため,日本語化された Tk をご利用ください.スクリプトのテストは,旧バージョ -ンの際に Tk4.2jp と Tk8.0jp の上で行っています (完璧にではないですが).今回 -のバージョンでは ruby-1.4.x + Tk8.0jp 上での簡単なテストしか行っていませんが, -修正というほどの修正はしていませんので問題はないと考えています. - -本アーカイブに含まれるスクリプトの多くは,元となっている Tcl/Tk 版に比較的近 -いスクリプト記述となるようにしています.そのため,Ruby/Tk のサンプルと言うに -は,あまり Ruby らしくないとも言えるでしょう.にもかかわらず,そのような記述 -を取っている理由は,Ruby/Tk のドキュメント不足にあります. - -Tcl/Tk には適当な参考書が何冊か存在していますから,Ruby/Tk スクリプトを作成 -する際は,そのような Tcl/Tk の参考書で情報を補いながら作成することになると思 -います.各 widget の使用例として,Tcl/Tk の widget-demo を参照することもある -でしょう.Ruby/Tk 版の記述を widget-demo を Tcl/Tk 版の記述に近いものにして -おけば,その対比によって,Ruby/Tk の理解を早めることができると考えられます. -一旦 Ruby/Tk での 各 widget の使用方法を習得してしまえば,Ruby らしいスクリ -プトを作成することは難しくないでしょう.本アーカイブのスクリプトは,Ruby/Tk -を最初に習得するまでの踏台として利用していただければ幸いです. - -widget-demo の移植にあたっては,次の方にも移植したスクリプトを提供していただ -きました.ここに感謝の意を表します. - - 立石@JAIST (ttate@jaist.ac.jp) さん - 平松祥史 (hiramatu@cdrom.co.jp) さん - -平松さんによる Ruby/Tk 入門の Web page (http://www.cdrom.co.jp/~hiramatu/) -も Ruby/Tk の習得に有用と思えますので,ぜひご参照ください. - -また,前橋 (maebashi@iij.ad.jp) さんをはじめとして,widget-demo の移植に際し -て必要となった Ruby の Tk 関連ライブラリ修正について,問題点,バグの指摘をし -ていただいた方々にも感謝致します. - -そして最後に最大の感謝を Ruby 設計者の まつもと ゆきひろ (matz@netlab.co.jp) -さんに捧げたいと思います. + 羂娯鐚ヨ緒箙綏ュぇ (nagai@ai.kyutech.ac.jp) + +罔羣絽 Tcl/Tk ≦宍宴若吾莨若 Ruby (篁ヤ Ruby/Tk 若潟障) +с鐚Tk widget GUI 篏茵с障鐚絎 GUI 篏 +翫罕絎箴泣潟絖箴水с鐚Ruby/Tk +綵泣潟鴻絖障с鐚絲障鐚 +≦宍宴若吾с Tcl/Tk 鐚Tk widget +腓冴 widget-demo 絖鐚Tcl/Tk GUI 篏 +膺緇篁h;泣潟c障鐚≪若ゃ鐚Ruby/Tk 膺緇 +篁h;泣潟鴻鴻鐚Tcl/Tk widget-demo 腱紙 +с鐚 + +篁若吾с潟 ruby-1.4.x 絲上障鐚с若吾с潟罸鴻鐚 +祉紊眼障鐚ruby-1.1c2 篁ヤ障鐚ruby-1.5.x +鴻障鐚鐚篋綵演帥冴障 +鐚翫с絨篆罩cу障鐚腟粋昭 Tk 若吾с潟鐚 +4.2 с 8.0 с篆罩cс鐚鐚ユ茯с腱紙c +鐚ユ茯 Tk 鐚鴻鴻鐚с若吾 +潟 Tk4.2jp Tk8.0jp 筝цc障 (絎ссс)鐚篁 +若吾с潟с ruby-1.4.x + Tk8.0jp 筝с膂≦鴻茵c障鐚 +篆罩c祉篆罩c障у馹障鐚 + +≪若ゃ障鴻紊鐚c Tcl/Tk 罸莠菴 +鴻荐菴違障鐚鐚Ruby/Tk 泣潟荐 +鐚障 Ruby 荐с鐚鐚荐菴 +c宴鐚Ruby/Tk ャ<潟筝莇潟障鐚 + +Tcl/Tk 綵吾篏絖障鐚Ruby/Tk 鴻篏 +鐚 Tcl/Tk 吾ф宴茖篏 +障鐚 widget 篏睡箴鐚Tcl/Tk widget-demo с +с鐚Ruby/Tk 荐菴違 widget-demo Tcl/Tk 荐菴違菴 +逸絲丈c鐚Ruby/Tk 茹cс障鐚 +筝 Ruby/Tk с widget 篏睡号膺緇障逸Ruby 鴻 +篏cс鐚≪若ゃ鴻鐚Ruby/Tk +膺緇障с荼伹医晃с鐚 + +widget-demo 腱紙c鐚罨<鴻腱紙鴻箴 +障鐚茗茵障鐚 + + 腴鰹JAIST (ttate@jaist.ac.jp) + 綛恰丞ゥ (hiramatu@cdrom.co.jp) + +綛恰障 Ruby/Tk ラ Web page (http://www.cdrom.co.jp/~hiramatu/) + Ruby/Tk 膺緇障э蚊с鐚 + +障鐚罘 (maebashi@iij.ad.jp) 鐚widget-demo 腱紙 +綽荀c Ruby Tk ∫cゃ篆罩cゃ鐚馹刻違 +鴻茗眼障鐚 + +緇紊с茗 Ruby 荐荐 障ゃ 蚊 (matz@netlab.co.jp) +с障鐚 diff --git a/ext/tk/sample/demos-jp/README.1st b/ext/tk/sample/demos-jp/README.1st index 60b278d7b6..68caf8b14d 100644 --- a/ext/tk/sample/demos-jp/README.1st +++ b/ext/tk/sample/demos-jp/README.1st @@ -1,20 +1,20 @@ -このディレクトリには Ruby/Tk のデモスクリプトが収められています. +c Ruby/Tk ≪鴻障鐚 -'.rb' という拡張子を持っているファイルは,ランチャ─スクリプトで -ある 'widget' から呼び出されるサブスクリプトです.それぞれ独立に -は動きません.'widget' スクリプトから呼び出してください. +'.rb' ≦宍絖c<ゃ鐚潟b鴻 + 'widget' 若喝冴泣鴻с鐚腴 +障鐚'widget' 鴻若喝冴鐚 -もしランチャ─スクリプト 'widget' の起動と同時にいくつかのサブス -クリプトを起動したければ,そのサブスクリプトの名前を引数として与 -えてください. -( 例: /usr/local/bin/ruby widget button.rb entry1.rb text.rb ) -サブスクリプトの拡張子 '.rb' は省略することもできます. -( 例: /usr/local/bin/ruby widget button entry1 text ) +潟b鴻 'widget' 莎桁ゃ泣 +莎桁逸泣鴻綣違筝 +鐚 +( 箴: /usr/local/bin/ruby widget button.rb entry1.rb text.rb ) +泣鴻≦宍絖 '.rb' ャс障鐚 +( 箴: /usr/local/bin/ruby widget button entry1 text ) -もしランチャ─スクリプトのウィンドウが必要ない場合には,'-n' オ -プションを与えてください. -( 例: /usr/local/bin/ruby widget -n button.rb entry1.rb text.rb ) +潟b鴻c潟綽荀翫鐚'-n' +激с潟筝鐚 +( 箴: /usr/local/bin/ruby widget -n button.rb entry1.rb text.rb ) -他のファイル (browse1 や hello など) は単独で動かすことが可能です. +篁<ゃ (browse1 hello ) у純с鐚 2004/04/14 Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) diff --git a/ext/tk/sample/demos-jp/anilabel.rb b/ext/tk/sample/demos-jp/anilabel.rb index d2f5b12041..c882f43f7e 100644 --- a/ext/tk/sample/demos-jp/anilabel.rb +++ b/ext/tk/sample/demos-jp/anilabel.rb @@ -1,16 +1,16 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # animated label widget demo (called by 'widget') # # based on Tcl/Tk8.5a2 widget demos -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($anilabel_demo) && $anilabel_demo $anilabel_demo.destroy $anilabel_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $anilabel_demo = TkToplevel.new {|w| title("Animated Label Demonstration") iconname("anilabel") @@ -19,20 +19,20 @@ $anilabel_demo = TkToplevel.new {|w| base_frame = TkFrame.new($anilabel_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下には4つのアニメーションラベルが表示されています。左側にあるラベルは、内部のテキストメッセージをスクロールしたように見せることで動きを付けています。右側のラベルは、表示するイメージを変化させることで動きを与えています。" + text "筝4ゃ≪<若激с潟茵腓冴障綏眼鴻<祉若吾鴻若荀у篁障勀眼茵腓冴ゃ<若吾紊у筝障" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $anilabel_demo $anilabel_demo = nil @@ -41,13 +41,13 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'anilabel'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# label demo 用フレーム生成 +# label demo 若 f_left = TkLabelFrame.new(base_frame, :text=>'Scrolling Texts') f_right = TkLabelFrame.new(base_frame, :text=>'GIF Image') Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both', @@ -123,7 +123,7 @@ class AnimatedImageLabel < AnimatedTextLabel private :_animation_callback end -# label 生成 +# label l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge, :font=>{:family=>'Courier', :size=>10}) l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove, diff --git a/ext/tk/sample/demos-jp/aniwave.rb b/ext/tk/sample/demos-jp/aniwave.rb index 973c1be1e9..866316c331 100644 --- a/ext/tk/sample/demos-jp/aniwave.rb +++ b/ext/tk/sample/demos-jp/aniwave.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # animated wave demo (called by 'widget') # @@ -24,15 +24,15 @@ msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text 'このデモでは、ラインアイテムが一つだけ描かれたキャンバスウィジェットが表示されています。アニメーション処理は、そのラインアイテムの座標値を変更することで実現しています。' + text '≪сゃ潟≪ゃ筝ゃc潟鴻c吾с茵腓冴障≪<若激с喝ゃ潟≪ゃ綺фゃ紊眼у憗障' } msg.pack('side'=>'top') # create frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $aniwave_demo $aniwave_demo = nil @@ -41,7 +41,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'aniwave'} }.pack('side'=>'left', 'expand'=>'yes') diff --git a/ext/tk/sample/demos-jp/arrow.rb b/ext/tk/sample/demos-jp/arrow.rb index a1694d019d..2995f96d54 100644 --- a/ext/tk/sample/demos-jp/arrow.rb +++ b/ext/tk/sample/demos-jp/arrow.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # arrowhead widget demo (called by 'widget') # @@ -91,13 +91,13 @@ def arrowSetup(c) v.count += 1 end -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($arrow_demo) && $arrow_demo $arrow_demo.destroy $arrow_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $arrow_demo = TkToplevel.new {|w| title("Arrowhead Editor Demonstration") iconname("arrow") @@ -106,17 +106,17 @@ $arrow_demo = TkToplevel.new {|w| base_frame = TkFrame.new($arrow_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"この widget で、キャンバスで使われるラインについて様々な幅や矢印の頭の形を試してみることができます。線の幅や矢印の形を変えるには、拡大された矢印についている 3つの四角をドラッグしてください。右側の矢印は普通の大きさでのサンプルを示しています。下のテキストはラインアイテムに対する設定オプションです。"){ + 'text'=>" widget сc潟鴻т戎ゃ潟ゃ罕綛√違綵≪荅帥с障膩綛√違綵≪紊≦ぇ√違ゃ 3ゃ茹違勀眼√違紊сс泣潟腓冴障筝鴻ゃ潟≪ゃ絲障荐絎激с潟с"){ pack('side'=>'top') } -# frame 生成 +# frame $arrow_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $arrow_demo $arrow_demo = nil @@ -125,18 +125,18 @@ $arrow_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'arrow'} }.pack('side'=>'left', 'expand'=>'yes') } $arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# canvas 設定 +# canvas 荐絎 $arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350, 'relief'=>'sunken', 'borderwidth'=>2) $arrow_canvas.pack('expand'=>'yes', 'fill'=>'both') -# 値設定 +# よ┃絎 unless Struct.const_defined?("ArrowInfo") $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc, :x1, :x2, :y, :smallTips, :count, diff --git a/ext/tk/sample/demos-jp/bind.rb b/ext/tk/sample/demos-jp/bind.rb index 99e5c1718c..efba6e6c01 100644 --- a/ext/tk/sample/demos-jp/bind.rb +++ b/ext/tk/sample/demos-jp/bind.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # text (tag bindings) widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($bind_demo) && $bind_demo $bind_demo.destroy $bind_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $bind_demo = TkToplevel.new {|w| title("Text Demonstration - Tag Bindings") iconname("bind") @@ -18,11 +18,11 @@ $bind_demo = TkToplevel.new {|w| base_frame = TkFrame.new($bind_demo).pack(:fill=>:both, :expand=>true) -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $bind_demo $bind_demo = nil @@ -31,20 +31,20 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'bind'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# bind 用メソッド +# bind <純 def tag_binding_for_bind_demo(tag, enter_style, leave_style) tag.bind('Any-Enter', proc{tag.configure enter_style}) tag.bind('Any-Leave', proc{tag.configure leave_style}) end -# text 生成 +# text txt = TkText.new(base_frame){|t| - # 生成 + # setgrid 'true' #width 60 #height 24 @@ -57,7 +57,7 @@ txt = TkText.new(base_frame){|t| } pack('expand'=>'yes', 'fill'=>'both') - # スタイル設定 + # 鴻帥ゃ荐絎 if TkWinfo.depth($root).to_i > 1 tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised', 'borderwidth'=>1} @@ -67,25 +67,25 @@ txt = TkText.new(base_frame){|t| tagstyle_normal = {'foreground'=>'', 'background'=>''} end - # テキスト挿入 - insert 'insert', "テキストwidgetの表示スタイルを制御するのと同じタグのメカニズムを使って、テキストにTclのコマンドを割り当てることができます。これにより、マウスやキーボードのアクションで特定のTclのコマンドが実行されるようになります。例えば、下のキャンバスのデモプログラムについての説明文にはそのようなタグがついています。マウスを説明文の上に持っていくと説明文が光り、ボタン1を押すとその説明のデモが始まります。 + # 鴻水 + insert 'insert', "鴻widget茵腓冴鴻帥ゃ九勝帥違<冴篏帥c鴻Tcl潟潟蚊綵с障鴻若若≪激с潟х劫Tcl潟潟絎茵障箴違筝c潟鴻≪違ゃ茯帥違ゃ障鴻茯筝c茯帥1若茯≪紮障障 " - insert('end', '1. キャンバス widget に作ることのできるアイテムの種類全てに関するサンプル。', (d1 = TkTextTag.new(t)) ) + insert('end', '1. c潟 widget 篏с≪ゃ腮蕁≪泣潟', (d1 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '2. 簡単な 2次元のプロット。データを表す点を動かすことができる。', (d2 = TkTextTag.new(t)) ) + insert('end', '2. 膂≦ 2罨≦若帥茵鴻с', (d2 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '3. テキストアイテムのアンカーと行揃え。', + insert('end', '3. 鴻≪ゃ≪潟若茵', (d3 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '4. ラインアイテムのための矢印の頭の形のエディタ。', + insert('end', '4. ゃ潟≪ゃ√違綵≪c帥', (d4 = TkTextTag.new(t)) ) insert('end', "\n\n") - insert('end', '5. タブストップを変更するための機能つきのルーラー。', + insert('end', '5. 帥鴻紊眼罘純ゃ若若', (d5 = TkTextTag.new(t)) ) insert('end', "\n\n") insert('end', - '6. キャンバスがどうやってスクロールするのかを示すグリッド。', + '6. c潟鴻c鴻若腓冴違', (d6 = TkTextTag.new(t)) ) # binding diff --git a/ext/tk/sample/demos-jp/bitmap.rb b/ext/tk/sample/demos-jp/bitmap.rb index 1193e8de24..d84e9a5f09 100644 --- a/ext/tk/sample/demos-jp/bitmap.rb +++ b/ext/tk/sample/demos-jp/bitmap.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # bitmap widget demo (called by 'widget') # @@ -25,13 +25,13 @@ def bitmapRow(w,*args) } end -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($bitmap_demo) && $bitmap_demo $bitmap_demo.destroy $bitmap_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $bitmap_demo = TkToplevel.new {|w| title("Bitmap Demonstration") iconname("bitmap") @@ -40,17 +40,17 @@ $bitmap_demo = TkToplevel.new {|w| base_frame = TkFrame.new($bitmap_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"このウィンドウには、Tk に組み込まれたすべてのビットマップが、それらの名前と共に表示されています。Tcl のスクリプト中では、それぞれの名前を用いて参照します。"){ + 'text'=>"c潟Tk 腟粋昭障鴻宴茵腓冴障Tcl 鴻筝сс障"){ pack('side'=>'top') } -# frame 生成 +# frame $bitmap_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $bitmap_demo $bitmap_demo = nil @@ -59,13 +59,13 @@ $bitmap_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'bitmap'} }.pack('side'=>'left', 'expand'=>'yes') } $bitmap_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 設定 +# frame 荐絎 TkFrame.new(base_frame){|f| bitmapRow(f,'error','gray25','gray50','hourglass') bitmapRow(f,'info','question','questhead','warning') diff --git a/ext/tk/sample/demos-jp/button.rb b/ext/tk/sample/demos-jp/button.rb index 87ced45810..301100b057 100644 --- a/ext/tk/sample/demos-jp/button.rb +++ b/ext/tk/sample/demos-jp/button.rb @@ -1,36 +1,36 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # button widget demo (called by 'widget') # # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($button_demo) && $button_demo $button_demo.destroy $button_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $button_demo = TkToplevel.new {|w| title("Button Demonstration") iconname("button") positionWindow(w) } -# label 生成 +# label msg = TkLabel.new($button_demo) { font $kanji_font wraplength '4i' justify 'left' - text "ボタンをクリックすると、ボタンの背景色がそのボタンに書かれている色になります。ボタンからボタンへの移動はタブを押すことでも可能です。またスペースで実行することができます。" + text "帥潟帥潟蚊帥潟吾蚊障帥潟帥潟吾腱糸帥若с純с障鴻若鴻у茵с障" } msg.pack('side'=>'top') -# frame 生成 +# frame $button_buttons = Tk::Frame.new($button_demo) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $button_demo $button_demo = nil @@ -39,13 +39,13 @@ $button_buttons = Tk::Frame.new($button_demo) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'button'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# button 生成 +# button TkButton.new($button_demo){ text "Peach Puff" width 10 diff --git a/ext/tk/sample/demos-jp/check.rb b/ext/tk/sample/demos-jp/check.rb index 762b99778b..422e898ec9 100644 --- a/ext/tk/sample/demos-jp/check.rb +++ b/ext/tk/sample/demos-jp/check.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # checkbutton widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($check_demo) && $check_demo $check_demo.destroy $check_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $check_demo = TkToplevel.new {|w| title("Checkbutton Demonstration") iconname("check") @@ -18,25 +18,25 @@ $check_demo = TkToplevel.new {|w| base_frame = TkFrame.new($check_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下には 3 つのチェックボタンが表示されています。クリックするとボタンの選択状態が変わり、Tcl 変数 ( TkVariable オブジェクトでアクセスできます ) にそのボタンの状態を示す値を設定します。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。" + text "筝 3 ゃс帥潟茵腓冴障帥潟御倶紊Tcl 紊 ( TkVariable 吾сс≪祉鴻с障 ) 帥潟倶腓冴ゃ荐絎障憜紊違ゃ荀紊医с帥潟" } msg.pack('side'=>'top') -# 変数生成 +# 紊亥 wipers = TkVariable.new(0) brakes = TkVariable.new(0) sober = TkVariable.new(0) -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $check_demo $check_demo = nil @@ -46,13 +46,13 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'check'} }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text '変数参照' + text '紊医' command proc{ showVars(base_frame, ['wipers', wipers], ['brakes', brakes], ['sober', sober]) @@ -62,9 +62,9 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# checkbutton 生成 -[ TkCheckButton.new(base_frame, 'text'=>'ワイパー OK', 'variable'=>wipers), - TkCheckButton.new(base_frame, 'text'=>'ブレーキ OK', 'variable'=>brakes), - TkCheckButton.new(base_frame, 'text'=>'運転手 素面', 'variable'=>sober) +# checkbutton +[ TkCheckButton.new(base_frame, 'text'=>'ゃ OK', 'variable'=>wipers), + TkCheckButton.new(base_frame, 'text'=>'若 OK', 'variable'=>brakes), + TkCheckButton.new(base_frame, 'text'=>'荵∽ 膣', 'variable'=>sober) ].each{|w| w.relief('flat'); w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')} diff --git a/ext/tk/sample/demos-jp/check2.rb b/ext/tk/sample/demos-jp/check2.rb index 9f845183f3..558e588535 100644 --- a/ext/tk/sample/demos-jp/check2.rb +++ b/ext/tk/sample/demos-jp/check2.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # checkbutton widget demo2 (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($check2_demo) && $check2_demo $check2_demo.destroy $check2_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $check2_demo = TkToplevel.new {|w| title("Checkbutton Demonstration 2") iconname("check2") @@ -18,37 +18,37 @@ $check2_demo = TkToplevel.new {|w| base_frame = TkFrame.new($check2_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下には4つのチェックボタンが表示されています。クリックするとボタンの選択状態が変わり、Tcl変数(TkVariableオブジェクトでアクセスできます)にそのボタンの状態を示す値を設定します。最初のボタンの状態は他の3つのボタンの状態にも依存して変化します。もし3つのボタンの一部だけにチェックが付けられている場合、最初のボタンはトライステート(3状態)モードでの表示を行います。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。" + text "筝鐚ゃс帥潟茵腓冴障帥潟御倶紊Tcl紊逸TkVariable吾сс≪祉鴻с障鐚帥潟倶腓冴ゃ荐絎障帥潟倶篁鐚ゃ帥潟倶箴絖紊障鐚ゃ帥潟筝с篁翫帥潟ゃ鴻若鐚鐚倶鐚≪若с茵腓冴茵障憜紊違ゃ荀紊医с帥潟" } msg.pack('side'=>'top') -# 変数生成 +# 紊亥 safety = TkVariable.new(0) wipers = TkVariable.new(0) brakes = TkVariable.new(0) sober = TkVariable.new(0) -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - TkButton.new(frame, :text=>'変数参照', + TkButton.new(frame, :text=>'紊医', :image=>$image['view'], :compound=>:left, :command=>proc{ showVars($check2_demo, ['safety', safety], ['wipers', wipers], ['brakes', brakes], ['sober', sober]) }), - TkButton.new(frame, :text=>'コード参照', + TkButton.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'check2'}), - TkButton.new(frame, :text=>'閉じる', + TkButton.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $check2_demo @@ -61,16 +61,16 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'bottom', 'fill'=>'x') -# checkbutton 生成 -TkCheckButton.new(base_frame, :text=>'安全性検査', :variable=>safety, +# checkbutton +TkCheckButton.new(base_frame, :text=>'絎ф', :variable=>safety, :relief=>:flat, :onvalue=>'all', :offvalue=>'none', :tristatevalue=>'partial'){ pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') } -[ TkCheckButton.new(base_frame, 'text'=>'ワイパー OK', 'variable'=>wipers), - TkCheckButton.new(base_frame, 'text'=>'ブレーキ OK', 'variable'=>brakes), - TkCheckButton.new(base_frame, 'text'=>'運転手 素面', 'variable'=>sober) +[ TkCheckButton.new(base_frame, 'text'=>'ゃ OK', 'variable'=>wipers), + TkCheckButton.new(base_frame, 'text'=>'若 OK', 'variable'=>brakes), + TkCheckButton.new(base_frame, 'text'=>'荵∽ 膣', 'variable'=>sober) ].each{|w| w.relief('flat') w.pack('side'=>'top', 'padx'=>15, 'pady'=>2, 'anchor'=>'w') diff --git a/ext/tk/sample/demos-jp/clrpick.rb b/ext/tk/sample/demos-jp/clrpick.rb index c188723c5a..df8c76a69d 100644 --- a/ext/tk/sample/demos-jp/clrpick.rb +++ b/ext/tk/sample/demos-jp/clrpick.rb @@ -1,35 +1,35 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # widget demo prompts the user to select a color (called by 'widget') # # Note: don't support ttk_wrapper. work with standard widgets only. # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($clrpick_demo) && $clrpick_demo $clrpick_demo.destroy $clrpick_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $clrpick_demo = TkToplevel.new {|w| title("Color Selection Dialogs") iconname("colors") positionWindow(w) } -# label 生成 +# label #TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', Tk::Label.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"以下のボタンを押して、このウィンドウ上にあるウィジェットの前景色と背景色を選択して下さい。").pack('side'=>'top') + 'text'=>"篁ヤ帥潟若c潟筝c吾с蚊蚊御筝").pack('side'=>'top') -# frame 生成 +# frame # TkFrame.new($clrpick_demo) {|frame| Tk::Frame.new($clrpick_demo) {|frame| # TkButton.new(frame) { Tk::Button.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $clrpick_demo $clrpick_demo = nil @@ -39,21 +39,21 @@ Tk::Frame.new($clrpick_demo) {|frame| # TkButton.new(frame) { Tk::Button.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'clrpick'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# button 生成 -# TkButton.new($clrpick_demo, 'text'=>'背景色を設定 ...') {|b| -Tk::Button.new($clrpick_demo, 'text'=>'背景色を設定 ...') {|b| +# button +# TkButton.new($clrpick_demo, 'text'=>'蚊荐絎 ...') {|b| +Tk::Button.new($clrpick_demo, 'text'=>'蚊荐絎 ...') {|b| command(proc{setColor $clrpick_demo, b, 'background', ['background', 'highlightbackground']}) pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') } -# TkButton.new($clrpick_demo, 'text'=>'前景色を設定 ...') {|b| -Tk::Button.new($clrpick_demo, 'text'=>'前景色を設定 ...') {|b| +# TkButton.new($clrpick_demo, 'text'=>'蚊荐絎 ...') {|b| +Tk::Button.new($clrpick_demo, 'text'=>'蚊荐絎 ...') {|b| command(proc{setColor $clrpick_demo, b, 'foreground', ['foreground']}) pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m') } diff --git a/ext/tk/sample/demos-jp/colors.rb b/ext/tk/sample/demos-jp/colors.rb index 9fcf0333b5..5e5f47cb04 100644 --- a/ext/tk/sample/demos-jp/colors.rb +++ b/ext/tk/sample/demos-jp/colors.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # listbox widget demo 'colors' (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($colors_demo) && $colors_demo $colors_demo.destroy $colors_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $colors_demo = TkToplevel.new {|w| title("Listbox Demonstration (colors)") iconname("colors") @@ -18,20 +18,20 @@ $colors_demo = TkToplevel.new {|w| base_frame = TkFrame.new($colors_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下には色の名前が入ったスクロールバー付のリストボックスが表示されています。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。ある色をボタン1(左ボタン)でダブルクリックするとアプリケーション全体がその色になります。" + text "筝蚊ャc鴻若寂鴻鴻茵腓冴障鴻鴻若鴻若若сс障鴻鴻筝с鴻帥2(筝帥)若障障違с障蚊帥1(綏帥)с≪宴若激с喝篏蚊障" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $colors_demo $colors_demo = nil @@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'colors'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame colors_lbox = nil TkFrame.new(base_frame, 'borderwidth'=>10) {|w| s = TkScrollbar.new(w) diff --git a/ext/tk/sample/demos-jp/combo.rb b/ext/tk/sample/demos-jp/combo.rb index 2059662d48..8bbe36997d 100644 --- a/ext/tk/sample/demos-jp/combo.rb +++ b/ext/tk/sample/demos-jp/combo.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # combo.rb -- # @@ -21,16 +21,16 @@ base_frame = TkFrame.new($combo_demo).pack(:fill=>:both, :expand=>true) Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top, :fill=>:x) -以下では3種類のコンボボックスが表示されています.\ -最初のものは,エントリウィジェットと同じ様に,\ -ポイントしたり,クリックしたり,タイプしたりすることができます.\ -また,Returnキーを入力すれば現在の値がリストに追加され,\ -ドロップダウンリストから選択することができるようになります.\ -↓(下向き矢印)キーを押して表示されたリストから\ -矢印キーで他の候補を選んでReturnキーを押せば,値を選択できます.\ -2番目のコンボボックスは特定の値に固定されており,一切変更できません.\ -3番目のものはオーストラリアの都市のドロップダウンリストから\ -選択することだけが可能となっています. +篁ヤс3腮蕁潟潟鴻茵腓冴障鐚\ +鐚潟c吾с罕鐚\ +ゃ潟鐚鐚帥ゃс障鐚\ +障鐚Return若ュ亥憜ゃ鴻菴遵鐚\ +潟鴻御с障鐚\ +(筝√)若若茵腓冴鴻\ +√違若т茖吾Return若若逸ゃ御с障鐚\ +2潟潟鴻劫ゃ阪鐚筝紊眼с障鐚\ +3若鴻≪遵潟鴻\ +御純c障鐚 EOL ## variables @@ -43,7 +43,7 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'変数参照', + Ttk::Button.new(frame, :text=>'紊医', :image=>$image['view'], :compound=>:left, :command=>proc{ showVars(base_frame, @@ -51,10 +51,10 @@ Ttk::Frame.new(base_frame) {|frame| ['secondVariable', secondValue], ['ozCity', ozCity]) }), - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'combo'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $combo_demo.destroy @@ -68,13 +68,13 @@ Ttk::Frame.new(base_frame) {|frame| frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true) australianCities = [ - 'キャンベラ', 'シドニー', 'メルボルン', 'パース', 'アデレード', - 'ブリスベーン', 'ホバート', 'ダーウィン', 'アリス スプリングス' + 'c潟', '激', '<', '若', '≪若', + '鴻若', '若', '若c', '≪ 鴻潟違' ] -secondValue.value = '変更不可' -ozCity.value = 'シドニー' +secondValue.value = '紊岩' +ozCity.value = '激' Tk.pack(Ttk::Labelframe.new(frame, :text=>'Fully Editable'){|f| Ttk::Combobox.new(f, :textvariable=>firstValue){|b| diff --git a/ext/tk/sample/demos-jp/cscroll.rb b/ext/tk/sample/demos-jp/cscroll.rb index 0a31f28b5e..e993326aa9 100644 --- a/ext/tk/sample/demos-jp/cscroll.rb +++ b/ext/tk/sample/demos-jp/cscroll.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # simple scrollable canvas widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($cscroll_demo) && $cscroll_demo $cscroll_demo.destroy $cscroll_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $cscroll_demo = TkToplevel.new {|w| title("Scrollable Canvas Demonstration") iconname("cscroll") @@ -18,17 +18,17 @@ $cscroll_demo = TkToplevel.new {|w| base_frame = TkFrame.new($cscroll_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', - 'justify'=>'left', 'text'=>"このウィンドウにはスクロールバーやマウスのボタン2 でスクロールできるキャンバス widget が表示されています。四角の上でボタン1 をクリックすると、そのインデックスが標準出力に出力されます。"){ + 'justify'=>'left', 'text'=>"c潟鴻若若鴻帥2 с鴻若сc潟 widget 茵腓冴障茹筝с帥1 ゃ潟鴻罔羣阪阪障"){ pack('side'=>'top') } -# frame 生成 +# frame $cscroll_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $cscroll_demo $cscroll_demo = nil @@ -37,13 +37,13 @@ $cscroll_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'cscroll'} }.pack('side'=>'left', 'expand'=>'yes') } $cscroll_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 設定 +# frame 荐絎 unless $tk_version =~ /^4\.[01]/ $cscroll_grid = TkFrame.new(base_frame) { pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1) @@ -52,7 +52,7 @@ unless $tk_version =~ /^4\.[01]/ TkGrid.columnconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0) end -# canvas 設定 +# canvas 荐絎 $cscroll_canvas = TkCanvas.new(base_frame, 'relief'=>'sunken', 'borderwidth'=>2, 'scrollregion'=>['-11c', '-11c', '50c', '20c'] diff --git a/ext/tk/sample/demos-jp/ctext.rb b/ext/tk/sample/demos-jp/ctext.rb index 70c1cad1a7..bb354c490e 100644 --- a/ext/tk/sample/demos-jp/ctext.rb +++ b/ext/tk/sample/demos-jp/ctext.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # Canvas Text widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($ctext_demo) && $ctext_demo $ctext_demo.destroy $ctext_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $ctext_demo = TkToplevel.new {|w| title("Canvas Text Demonstration") iconname("Text") @@ -18,23 +18,23 @@ $ctext_demo = TkToplevel.new {|w| base_frame = TkFrame.new($ctext_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"このウィンドウにはキャンバスwidgetのテキスト機能をデモするためのテキスト文字列が表示されています。マウスを四角の中に持っていき、クリックすると位置ぎめ用の点からの相対位置を変えたり、行揃えを変えたりすることができます。また以下のような編集のための簡単なバインディングをサポートしています。 + 'text'=>"c潟c潟widget鴻罘純≪鴻絖茵腓冴障鴻茹筝c篏臀鴻後鞘臀紊茵紊с障障篁ヤ膩膂≦ゃ潟c潟違泣若障 - 1. マウスを持っていき、クリックし、入力できます。 - 2. ボタン1で選択できます。 - 3. マウスの位置にボタン2で選択したテキストをコピーできます。 - 4.バックスペースをコントロール-Hで挿入カーソルの直前の文字を削除します。 - 5. Deleteキーは挿入カーソルの直後の文字を削除します。"){ + 1. 鴻cュс障 + 2. 帥1ч御с障 + 3. 鴻篏臀帥2ч御鴻潟若с障 + 4.鴻若鴻潟潟若-Hф水ャ若純翫絖ゃ障 + 5. Delete若水ャ若純翫絖ゃ障"){ pack('side'=>'top') } -# frame 生成 +# frame $ctext_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $ctext_demo $ctext_demo = nil @@ -43,30 +43,30 @@ $ctext_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'ctext'} }.pack('side'=>'left', 'expand'=>'yes') } $ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# canvas 生成 +# canvas $ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat', 'borderwidth'=>0, 'width'=>500, 'height'=>350) $ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both') -# font 設定 +# font 荐絎 if $tk_version =~ /^4.*/ textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*' else textFont = 'Helvetica 24' end -# canvas 設定 +# canvas 荐絎 TkcRectangle.new($ctext_canvas, 245, 195, 255, 205, 'outline'=>'black', 'fill'=>'red') ctag_text_param = { - 'text'=>"これはキャンバスwidgetのテキスト機能をデモするための文字列です。\n上で述べたような編集を可能とするためのバインディングを施しています。", + 'text'=>"c潟widget鴻罘純≪絖с\n筝ц唇鴻膩純ゃ潟c潟違純障", 'width'=>440, 'anchor'=>'n', 'justify'=>'left' } if $tk_version =~ /^4.*/ diff --git a/ext/tk/sample/demos-jp/dialog1.rb b/ext/tk/sample/demos-jp/dialog1.rb index 07e50306ab..e50c9071e5 100644 --- a/ext/tk/sample/demos-jp/dialog1.rb +++ b/ext/tk/sample/demos-jp/dialog1.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # a dialog box with a local grab (called by 'widget') # @@ -11,7 +11,7 @@ class TkDialog_Demo1 < TkDialog end def message - 'モーダルダイアログボックスです。Tk の "grab" コマンドを使用してダイアログボックスで「ローカルグラブ」しています。下のいずれかのボタンを実行することによって、このダイアログに答えるまで、このグラブによってアプリケーションの他のウィンドウでは、ポインタ関係のイベントを受け取ることができなくなっています。' + '≪若ゃ≪違鴻сTk "grab" 潟潟篏睡ゃ≪違鴻с若違障筝帥潟絎茵cゃ≪違膈障с違c≪宴若激с潟篁c潟сゃ潟翠≫ゃ潟сc障' end def bitmap @@ -23,17 +23,17 @@ class TkDialog_Demo1 < TkDialog end def buttons -# "了解 キャンセル コード参照" - ["了解", "キャンセル", "コード参照"] +# "篋茹 c潟祉 潟若" + ["篋茹", "c潟祉", "潟若"] end end ret = TkDialog_Demo1.new('message_config'=>{'wraplength'=>'4i'}).value case ret when 0 - print "あなたは「了解」を押しましたね。\n" + print "篋茹c若障\n" when 1 - print "あなたは「キャンセル」を押しましたね。\n" + print "c潟祉若障\n" when 2 showCode 'dialog1' end diff --git a/ext/tk/sample/demos-jp/dialog2.rb b/ext/tk/sample/demos-jp/dialog2.rb index f747f8d6a8..3e7d9619a4 100644 --- a/ext/tk/sample/demos-jp/dialog2.rb +++ b/ext/tk/sample/demos-jp/dialog2.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # a dialog box with a global grab (called by 'widget') # @@ -11,7 +11,7 @@ class TkDialog_Demo2 < TkDialog end def message - 'このダイアログボックスはグローバルグラブを使用しています。下のボタンを実行するまで、ディスプレイ上のいかなるものとも対話できません。グローバルグラブを使用することは、まず良い考えではありません。どうしても必要になるまで使おうと思わないで下さい。' + 'ゃ≪違鴻違若違篏睡障筝帥潟絎茵障сc鴻や絲乗宴с障違若違篏睡障с障綽荀障т戎т' end def bitmap @@ -23,8 +23,8 @@ class TkDialog_Demo2 < TkDialog end def buttons -# "了解 キャンセル コード参照" - ["了解", "キャンセル", "コード参照"] +# "篋茹 c潟祉 潟若" + ["篋茹", "c潟祉", "潟若"] end end @@ -34,9 +34,9 @@ ret = TkDialog_Demo2.new('message_config'=>{'wraplength'=>'4i'}, }).value case ret when 0 - print "あなたは「了解」を押しましたね。\n" + print "篋茹c若障\n" when 1 - print "あなたは「キャンセル」を押しましたね。\n" + print "c潟祉若障\n" when 2 showCode 'dialog2' end diff --git a/ext/tk/sample/demos-jp/entry1.rb b/ext/tk/sample/demos-jp/entry1.rb index eb71e87aec..9be677d12d 100644 --- a/ext/tk/sample/demos-jp/entry1.rb +++ b/ext/tk/sample/demos-jp/entry1.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # entry (no scrollbars) widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($entry1_demo) && $entry1_demo $entry1_demo.destroy $entry1_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $entry1_demo = TkToplevel.new {|w| title("Entry Demonstration (no scrollbars)") iconname("entry1") @@ -18,20 +18,20 @@ $entry1_demo = TkToplevel.new {|w| base_frame = TkFrame.new($entry1_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '5i' justify 'left' - text "3種類の異なるエントリが表示されています。文字を入力するにはポインタを持って行き、クリックしてからタイプしてください。標準的なMotifの編集機能が、Emacsのキーバインドとともに、サポートされています。例えば、バックスペースとコントロール-Hはカーソルの左の文字を削除し、デリートキーとコントロール-Dはカーソルの右側の文字を削除します。長過ぎてウィンドウに入り切らないものは、マウスのボタン2を押したままドラッグすることでスクロールさせることができます。日本語を入力するのはコントロール-バックスラッシュです。kinput2が動いていれば入力することができます。" + text "3腮蕁違潟茵腓冴障絖ュゃ潟帥c茵帥ゃ罔羣Motif膩罘純Emacs若ゃ潟泣若障箴違鴻若鴻潟潟若-H若純綏絖ゃ若若潟潟若-D若純勀眼絖ゃ障潔c潟ャ鴻帥2若障障違с鴻若с障ユ茯ュ潟潟若-鴻激ャсkinput2医ュс障" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $entry1_demo $entry1_demo = nil @@ -40,21 +40,21 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'entry1'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# entry 生成 +# entry e1 = TkEntry.new(base_frame, 'relief'=>'sunken') e2 = TkEntry.new(base_frame, 'relief'=>'sunken') e3 = TkEntry.new(base_frame, 'relief'=>'sunken') [e1,e2,e3].each{|w| w.pack('side'=>'top', 'padx'=>10, 'pady'=>5, 'fill'=>'x')} -# 初期値挿入 -e1.insert(0, '初期値') -e2.insert('end', "このエントリには長い文字列が入っていて、") -e2.insert('end', "長すぎてウィンドウには入り切らないので、") -e2.insert('end', "実際の所終りまで見るにはスクロールさせなければ") -e2.insert('end', "ならないでしょう。") +# ゆ水 +e1.insert(0, '') +e2.insert('end', "潟激絖ャc") +e2.insert('end', "激c潟ャс") +e2.insert('end', "絎腟障ц鴻若") +e2.insert('end', "с") diff --git a/ext/tk/sample/demos-jp/entry2.rb b/ext/tk/sample/demos-jp/entry2.rb index b5187ab508..5476d24ade 100644 --- a/ext/tk/sample/demos-jp/entry2.rb +++ b/ext/tk/sample/demos-jp/entry2.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # entry (with scrollbars) widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($entry2_demo) && $entry2_demo $entry2_demo.destroy $entry2_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $entry2_demo = TkToplevel.new {|w| title("Entry Demonstration (with scrollbars)") iconname("entry2") @@ -18,20 +18,20 @@ $entry2_demo = TkToplevel.new {|w| base_frame = TkFrame.new($entry2_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '5i' justify 'left' - text "3種類の異なるエントリが各々スクロールバー付で表示されています。文字を入力するにはポインタを持って行き、クリックしてからタイプしてください。標準的なMotifの編集機能が、Emacsのキーバインドとともに、サポートされています。例えば、バックスペースとコントロール-Hはカーソルの左の文字を削除し、デリートキーとコントロール-Dはカーソルの右側の文字を削除します。長過ぎてウィンドウに入り切らないものは、マウスのボタン2を押したままドラッグすることでスクロールさせることができます。日本語を入力するのはコントロール-バックスラッシュです。kinput2が動いていれば入力することができます。" + text "3腮蕁違潟鴻若寂ц;腓冴障絖ュゃ潟帥c茵帥ゃ罔羣Motif膩罘純Emacs若ゃ潟泣若障箴違鴻若鴻潟潟若-H若純綏絖ゃ若若潟潟若-D若純勀眼絖ゃ障潔c潟ャ鴻帥2若障障違с鴻若с障ユ茯ュ潟潟若-鴻激ャсkinput2医ュс障" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $entry2_demo $entry2_demo = nil @@ -40,12 +40,12 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'entry2'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame TkFrame.new(base_frame, 'borderwidth'=>10) {|w| # entry 1 s1 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz') @@ -80,12 +80,12 @@ TkFrame.new(base_frame, 'borderwidth'=>10) {|w| e3.pack('side'=>'top', 'fill'=>'x') s3.pack('side'=>'top', 'fill'=>'x') - # 初期値挿入 - e1.insert(0, '初期値') - e2.insert('end', "このエントリには長い文字列が入っていて、") - e2.insert('end', "長すぎてウィンドウには入り切らないので、") - e2.insert('end', "実際の所終りまで見るにはスクロールさせなければ") - e2.insert('end', "ならないでしょう。") + # ゆ水 + e1.insert(0, '') + e2.insert('end', "潟激絖ャc") + e2.insert('end', "激c潟ャс") + e2.insert('end', "絎腟障ц鴻若") + e2.insert('end', "с") }.pack('side'=>'top', 'fill'=>'x', 'expand'=>'yes') diff --git a/ext/tk/sample/demos-jp/entry3.rb b/ext/tk/sample/demos-jp/entry3.rb index 2728de0b93..59c698de62 100644 --- a/ext/tk/sample/demos-jp/entry3.rb +++ b/ext/tk/sample/demos-jp/entry3.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # entry3.rb -- # # This demonstration script creates several entry widgets whose @@ -23,33 +23,33 @@ base_frame = TkFrame.new($entry3_demo).pack(:fill=>:both, :expand=>true) TkLabel.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top) -以下には4種類のエントリボックスが表示されています.各エントリボックスは,\ -マウスクリックで選択し文字を打ち込むことが可能ですが,それぞれがどのような\ -入力を受け付けることができるかには制約が設けられています.\ -一つめのエントリボックスは整数と見なされる文字列か入力文字がない空の状態か\ -の場合だけを受け付け,問題がある場合はエントリボックスが点滅します\ -(フォーカスが去る時にチェックされます).\ -二つめのエントリボックスは,入力された文字列の長さが\ -10文字未満の場合だけを受け付け,制限を越えて書き込もうとしたときには\ -ベルを鳴らして知らせます.\ -三つめは米国の電話番号を受け付けるエントリボックスです.\ -アルファベットは,電話機のダイヤル上で対応づけられている数字に変換されます.\ -不適切な文字が入力されたり数字以外の文字の位置に数字を入力しようとしたり\ -した場合には警告のベルが鳴ります.\ -四つめのエントリボックスは,8文字までの入力を受け付ける\ -パスワードフィールドです(8文字以上は特に警告を出すことなく無視されます).\ -入力された文字はアスタリスク記号に置き換えて表示されます. +篁ヤ鐚腮蕁潟鴻茵腓冴障鐚潟鴻鐚\ +鴻ч御絖∴昭純с鐚\ +ュ篁с句荐障鐚\ +筝ゃ潟鴻贋違荀絖ュ絖腥冴倶\ +翫篁鐚馹翫潟鴻号障\ +鐚若鴻サс障鐚鐚\ +篋ゃ潟鴻鐚ュ絖激\ +鐚鐚絖羣翫篁鐚狗莇吾莨若\ +薐眼ャ障鐚\ +筝ゃ膠喝純肢援垩篁潟鴻с鐚\ +≪<鐚肢掩ゃゃ筝у上ャ医紊障鐚\ +筝絖ュ医篁ュ絖篏臀医ュ\ +翫茘薐眼障鐚\ +ゃ潟鴻鐚鐚絖障сュ篁\ +鴻若c若с鐚鐚絖篁ヤ鴻茘冴∴障鐚鐚\ +ュ絖≪鴻帥鴻荐垩臀茵腓冴障鐚 EOL TkFrame.new(base_frame){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'', :width=>15, :command=>proc{ $entry3_demo.destroy $entry3_demo = nil }).pack(:side=>:left, :expand=>true) - TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'潟若', :width=>15, :command=>proc{ showCode 'entry3' }).pack(:side=>:left, :expand=>true) } @@ -90,7 +90,7 @@ def focusAndFlash(widget, fg, bg, count=5) widget.focus(true) end -l1 = TkLabelFrame.new(base_frame, :text=>"整数エントリ") +l1 = TkLabelFrame.new(base_frame, :text=>"贋違潟") TkEntry.new(l1, :validate=>:focus, :vcmd=>[ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P' @@ -101,7 +101,7 @@ TkEntry.new(l1, :validate=>:focus, pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') } -l2 = TkLabelFrame.new(base_frame, :text=>"長さ制約付きエントリ") +l2 = TkLabelFrame.new(base_frame, :text=>"激句篁潟") TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell}, :vcmd=>[proc{|s| s.length < 10}, '%P'] ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') @@ -190,7 +190,7 @@ def validatePhoneChange(widget, vmode, idx, char) end -l3 = TkLabelFrame.new(base_frame, :text=>"米国電話番号エントリ") +l3 = TkLabelFrame.new(base_frame, :text=>"膠喝初肢援垩潟") TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, :textvariable=>entry3content, :vcmd=>[ @@ -209,7 +209,7 @@ TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell}, pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m') } -l4 = TkLabelFrame.new(base_frame, :text=>"パスワードエントリ") +l4 = TkLabelFrame.new(base_frame, :text=>"鴻若潟") TkEntry.new(l4, :validate=>:key, :show=>'*', :vcmd=>[ proc{|s| s.length <= 8}, diff --git a/ext/tk/sample/demos-jp/filebox.rb b/ext/tk/sample/demos-jp/filebox.rb index ffe5fbc5c6..fc014bc282 100644 --- a/ext/tk/sample/demos-jp/filebox.rb +++ b/ext/tk/sample/demos-jp/filebox.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # widget demo prompts the user to select a file (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($filebox_demo) && $entry2_demo $filebox_demo.destroy $filebox_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $filebox_demo = TkToplevel.new {|w| title("File Selection Dialogs") iconname("filebox") @@ -18,15 +18,15 @@ $filebox_demo = TkToplevel.new {|w| base_frame = TkFrame.new($filebox_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left', - 'text'=>"エントリにファイル名を直接入力するか、\"Browse\" ボタンを押してファイル選択ダイアログからファイル名を選んで下さい。").pack('side'=>'top') + 'text'=>"潟<ゃ贋・ュ\"Browse\" 帥潟若<ゃ御ゃ≪違<ゃ吾т").pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $filebox_demo $filebox_demo = nil @@ -35,15 +35,15 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'filebox'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 -['開く', '保存'].each{|type| +# frame +['', '篆絖'].each{|type| TkFrame.new(base_frame) {|f| - TkLabel.new(f, 'text'=>"ファイルを#{type}: ", 'anchor'=>'e')\ + TkLabel.new(f, 'text'=>"<ゃ#{type}: ", 'anchor'=>'e')\ .pack('side'=>'left') TkEntry.new(f, 'width'=>20) {|e| @@ -61,7 +61,7 @@ TkFrame.new(base_frame) {|frame| $tk_strictMotif = TkVarAccess.new('tk_strictMotif') if ($tk_platform['platform'] == 'unix') TkCheckButton.new(base_frame, - 'text'=>'Motifスタイルのダイアログを用いる', + 'text'=>'Motif鴻帥ゃゃ≪違', 'variable'=>$tk_strictMotif, 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c') end @@ -83,7 +83,7 @@ def fileDialog(w,ent,operation) ['All files', '*' ] ] - if operation == '開く' + if operation == '' file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w) else file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w, diff --git a/ext/tk/sample/demos-jp/floor.rb b/ext/tk/sample/demos-jp/floor.rb index 78cc23a245..5101a026bb 100644 --- a/ext/tk/sample/demos-jp/floor.rb +++ b/ext/tk/sample/demos-jp/floor.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # floorDisplay widget demo (called by 'widget') # @@ -50,7 +50,7 @@ def floorDisplay(w,active) # Create items for the room entry and its label. TkcWindow.new(w, 600, 100, 'anchor'=>'w', 'window'=>$floor_entry) - TkcText.new(w, 600, 100, 'anchor'=>'e', 'text'=>"部屋番号: ") + TkcText.new(w, 600, 100, 'anchor'=>'e', 'text'=>"絮: ") w['scrollregion'] = w.bbox('all') end @@ -1572,13 +1572,13 @@ end # Below is the "main program" that creates the floorplan demonstration. -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($floor_demo) && $floor_demo $floor_demo.destroy $floor_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $floor_demo = TkToplevel.new {|w| title("Floorplan Canvas Demonstration") iconname("Floorplan") @@ -1589,17 +1589,17 @@ $floor_demo = TkToplevel.new {|w| base_frame = TkFrame.new($floor_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', - 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){ + 'text'=>"c潟c吾帥ゃ<潟腓障с鴻帥潟泣若 (DECWRL) 吾c潟 widget ャc障 3綮冴с絽吾<1御ゃ障茵腓冴c障御筝с鴻綏帥潟鴻御筝筝絮蚊紊絮垩絮:潟茵腓冴障障潟絮垩吾絮蚊紊障"){ pack('side'=>'top') } -# frame 生成 +# frame $floor_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $floor_demo $floor_demo = nil @@ -1608,17 +1608,17 @@ $floor_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'floor'} }.pack('side'=>'left', 'expand'=>'yes') } $floor_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# 変数設定 +# 紊域┃絎 $floorLabels = {} $floorItems = {} -# canvas 設定 +# canvas 荐絎 if $tk_version =~ /^4\.[01]/ $floor_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken', 'highlightthickness'=>2) diff --git a/ext/tk/sample/demos-jp/floor2.rb b/ext/tk/sample/demos-jp/floor2.rb index 92ace6b51a..7ca705c7bd 100644 --- a/ext/tk/sample/demos-jp/floor2.rb +++ b/ext/tk/sample/demos-jp/floor2.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # floorDisplay widget demo 2 (called by 'widget') # @@ -50,7 +50,7 @@ def floorDisplay2(w,active) # Create items for the room entry and its label. w.create(TkcWindow, 600, 100, 'anchor'=>'w', 'window'=>$floor2_entry) - w.create(TkcText, 600, 100, 'anchor'=>'e', 'text'=>"部屋番号: ") + w.create(TkcText, 600, 100, 'anchor'=>'e', 'text'=>"絮: ") w['scrollregion'] = w.bbox('all') end @@ -1572,13 +1572,13 @@ end # Below is the "main program" that creates the floorplan demonstration. -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($floor2_demo) && $floor2_demo $floor2_demo.destroy $floor2_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $floor2_demo = TkToplevel.new {|w| title("Floorplan Canvas Demonstration 2") iconname("Floorplan2") @@ -1589,17 +1589,17 @@ $floor2_demo = TkToplevel.new {|w| base_frame = TkFrame.new($floor2_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left', - 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){ + 'text'=>"c潟c吾帥ゃ<潟腓障с鴻帥潟泣若 (DECWRL) 吾c潟 widget ャc障 3綮冴с絽吾<1御ゃ障茵腓冴c障御筝с鴻綏帥潟鴻御筝筝絮蚊紊絮垩絮:潟茵腓冴障障潟絮垩吾絮蚊紊障"){ pack('side'=>'top') } -# frame 生成 +# frame $floor2_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $floor2_demo $floor2_demo = nil @@ -1608,17 +1608,17 @@ $floor2_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'floor2'} }.pack('side'=>'left', 'expand'=>'yes') } $floor2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# 変数設定 +# 紊域┃絎 $floorLabels2 = {} $floorItems2 = {} -# canvas 設定 +# canvas 荐絎 if $tk_version =~ /^4\.[01]/ $floor2_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken', 'highlightthickness'=>2) diff --git a/ext/tk/sample/demos-jp/form.rb b/ext/tk/sample/demos-jp/form.rb index 84ed94de88..000fcb5091 100644 --- a/ext/tk/sample/demos-jp/form.rb +++ b/ext/tk/sample/demos-jp/form.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # form widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($form_demo) && $form_demo $form_demo.destroy $form_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $form_demo = TkToplevel.new {|w| title("Form Demonstration") iconname("form") @@ -18,20 +18,20 @@ $form_demo = TkToplevel.new {|w| base_frame = TkFrame.new($form_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "このウィンドウは簡単なフォーム入力用になっていて、さまざまなエントリに入力ができます。タブでエントリの切替えができます。" + text "c潟膂≦若ュc障障潟ュс障帥с潟帥с障" } msg.pack('side'=>'top', 'fill'=>'x') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $form_demo $form_demo = nil @@ -40,12 +40,12 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'form'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# entry 生成 +# entry form_data = [] (1..5).each{|i| f = TkFrame.new(base_frame, 'bd'=>2) @@ -56,10 +56,10 @@ form_data = [] form_data[i] = {'frame'=>f, 'entry'=>e, 'label'=>l} } -# 文字列設定 -form_data[1]['label'].text('名前:') -form_data[2]['label'].text('住所:') -form_data[5]['label'].text('電話:') +# 絖荐絎 +form_data[1]['label'].text(':') +form_data[2]['label'].text('篏:') +form_data[5]['label'].text('肢:') # pack (1..5).each{|i| form_data[i]['frame'].pack('side'=>'top', 'fill'=>'x')} diff --git a/ext/tk/sample/demos-jp/goldberg.rb b/ext/tk/sample/demos-jp/goldberg.rb index ea521b82ec..fc38d877db 100644 --- a/ext/tk/sample/demos-jp/goldberg.rb +++ b/ext/tk/sample/demos-jp/goldberg.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # Ruby/Tk Goldverg demo (called by 'widget') # @@ -63,7 +63,7 @@ msg = TkLabel.new($goldberg_demo) { font 'Arial 10' wraplength '4i' justify 'left' - text "これは、あなたが自分のアニメーションをいかに入り組んだものにできるかを示すというだけのためのデモです。ボールをクリックすれば物が動き始めます!\n\n\"Man will always find a difficult means to perform a simple task\"\n - Rube Goldberg" + text "≪<若激с潟ャ腟с腓冴≪с若亥紮障鐚\n\n\"Man will always find a difficult means to perform a simple task\"\n - Rube Goldberg" } msg.pack('side'=>'top') =end @@ -72,7 +72,7 @@ msg.pack('side'=>'top') # frame TkFrame.new($goldberg_demo) {|frame| TkButton.new(frame) { - text '閉じる' + text '' command proc{ tmppath = $goldberg_demo $goldberg_demo = nil @@ -81,7 +81,7 @@ TkFrame.new($goldberg_demo) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'goldberg'} }.pack('side'=>'left', 'expand'=>'yes') @@ -99,7 +99,7 @@ class TkGoldberg_Demo @S['speed'] = TkVariable.new(5) @S['cnt'] = TkVariable.new(0) # @S['message'] = TkVariable.new("\\nWelcome\\nto\\nRuby/Tk") - @S['message'] = TkVariable.new("\\n ようこそ!\\nRuby/Tk\\nの\\n世界へ") + @S['message'] = TkVariable.new("\\n 鐚\\nRuby/Tk\\n\\n筝") @S['pause'] = TkVariable.new @S['details'] = TkVariable.new(true) @@ -184,7 +184,7 @@ class TkGoldberg_Demo font 'Arial 10' wraplength 600 justify 'left' - text "これは、あなたが自分のアニメーションをいかに入り組んだものにできるかを示すというだけのためのデモです。ボールをクリックすれば物が動き始めます!\n\"Man will always find a difficult means to perform a simple task\" - Rube Goldberg" + text "≪<若激с潟ャ腟с腓冴≪с若亥紮障鐚\n\"Man will always find a difficult means to perform a simple task\" - Rube Goldberg" } msg.place(:in=>@canvas, :relx=>0, :rely=>0, :anchor=>:nw) @@ -192,7 +192,7 @@ class TkGoldberg_Demo # TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) { Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) { - text '閉じる' + text '' command proc{ tmppath = $goldberg_demo $goldberg_demo = nil @@ -202,7 +202,7 @@ class TkGoldberg_Demo # TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) { Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) { - text 'コード参照' + text '潟若' command proc{showCode 'goldberg'} }.pack('side'=>'left', 'padx'=>5) @@ -420,7 +420,7 @@ class TkGoldberg_Demo color = @C['0'] TkcText.new(@canvas, # [579, 119], :text=>'START HERE!', - [558, 119], :text=>'ここからスタート!', + [558, 119], :text=>'鴻帥若鐚', :fill=>color, :anchor=>:w, :tag=>'I0', :font=>['Times Roman', 12, :italic, :bold]) TkcLine.new(@canvas, [719, 119, 763, 119], :tag=>'I0', :fill=>color, @@ -1792,7 +1792,7 @@ class TkGoldberg_Demo @canvas.delete('I24', 'I26') TkcText.new(@canvas, 430, 735, :anchor=>:s, :tag=>'I26', #:text=>'click to continue', - :text=>'クリックでリセットします', + :text=>'с祉障', :font=>['Times Roman', 20, :bold]) @canvas.bind('1', proc{reset}) return 4 diff --git a/ext/tk/sample/demos-jp/hello b/ext/tk/sample/demos-jp/hello index 08f154d499..e942f3d851 100644 --- a/ext/tk/sample/demos-jp/hello +++ b/ext/tk/sample/demos-jp/hello @@ -1,10 +1,10 @@ #!/usr/bin/env ruby -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- require 'tk' TkButton.new(nil, - 'text'=>"こんにちは、世界", - 'command'=>proc{print "こんにちは、世界\n"; exit} + 'text'=>"<筝", + 'command'=>proc{print "<筝\n"; exit} ).pack Tk.mainloop diff --git a/ext/tk/sample/demos-jp/hscale.rb b/ext/tk/sample/demos-jp/hscale.rb index 5615aa50bd..2dfbf38272 100644 --- a/ext/tk/sample/demos-jp/hscale.rb +++ b/ext/tk/sample/demos-jp/hscale.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- require "tkcanvas" if defined?($hscale_demo) && $hscale_deom @@ -18,16 +18,16 @@ msg = TkLabel.new(base_frame) { font $font wraplength '3.5i' justify 'left' - text "下には矢印が1つと水平なスケールが表示されています。\ -スケール上でマウスボタン1をクリック、またはドラッグすると\ -矢印の長さを変えることができます。" + text "筝√違1ゃ羂翫抗鴻宴若茵腓冴障\ +鴻宴若筝с鴻帥1障違\ +√違激紊с障" } msg.pack('side'=>'top') TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc { tmppath = $hscale_demo $hscale_demo = nil @@ -36,7 +36,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc { showCode 'hscale' } }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') diff --git a/ext/tk/sample/demos-jp/icon.rb b/ext/tk/sample/demos-jp/icon.rb index 935519435b..6b9e1a570a 100644 --- a/ext/tk/sample/demos-jp/icon.rb +++ b/ext/tk/sample/demos-jp/icon.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # iconic button widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($icon_demo) && $icon_demo $icon_demo.destroy $icon_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $icon_demo = TkToplevel.new {|w| title("Iconic Button Demonstration") iconname("icon") @@ -18,20 +18,20 @@ $icon_demo = TkToplevel.new {|w| base_frame = TkFrame.new($icon_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '5i' justify 'left' - text "このウィンドウにはラジオボタンとチェックボタン上にビットマップや画像を表示する 3 つの方法を示しています。左にあるのは2つのラジオボタンで、それぞれが、ビットマップと選択を示すインジケータでできています。中央にあるのは、選択済みかどうかによって異なる画像を表示するチェックボタンです。右側にあるのは選択済みかどうかによって背景色が変わるビットマップを表示するチェックボタンです。" + text "c潟吾帥潟с帥割糸茵腓冴 3 ゃ号腓冴障綏2ゃ吾帥潟с御腓冴ゃ潟吾宴若帥сс障筝紊御羝帥c違糸茵腓冴с帥潟с勀眼御羝帥c蚊紊茵腓冴с帥潟с" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $icon_demo $icon_demo = nil @@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'icon'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# image 生成 +# image flagup = \ TkBitmapImage.new('file'=>[$demo_dir,'..', 'images','flagup.xbm'].join(File::Separator), @@ -59,10 +59,10 @@ TkBitmapImage.new('file'=>[$demo_dir,'..', [$demo_dir,'..', 'images','flagdown.xbm'].join(File::Separator)) -# 変数生成 +# 紊亥 letters = TkVariable.new -# frame 生成 +# frame TkFrame.new(base_frame, 'borderwidth'=>10){|w| TkFrame.new(w) {|f| # TkRadioButton.new(f){ diff --git a/ext/tk/sample/demos-jp/image1.rb b/ext/tk/sample/demos-jp/image1.rb index 10078c6c22..0c69b2a45f 100644 --- a/ext/tk/sample/demos-jp/image1.rb +++ b/ext/tk/sample/demos-jp/image1.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # two image widgets demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($image1_demo) && $image1_demo $image1_demo.destroy $image1_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $image1_demo = TkToplevel.new {|w| title('Image Demonstration #1') iconname("Image1") @@ -18,20 +18,20 @@ $image1_demo = TkToplevel.new {|w| base_frame = TkFrame.new($image1_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "このデモでは2つのラベル上に画像をそれぞれ表示しています。" + text "≪с2ゃ筝糸茵腓冴障" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $image1_demo $image1_demo = nil @@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'image1'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# image 生成 +# image image1a = \ TkPhotoImage.new('file'=>[$demo_dir,'..', 'images','earth.gif'].join(File::Separator)) @@ -54,7 +54,7 @@ image1b = \ TkPhotoImage.new('file'=>[$demo_dir,'..', 'images','earthris.gif'].join(File::Separator)) -# label 生成 +# label #[ TkLabel.new(base_frame, 'image'=>image1a, 'bd'=>1, 'relief'=>'sunken'), # TkLabel.new(base_frame, 'image'=>image1b, 'bd'=>1, 'relief'=>'sunken') #].each{|w| w.pack('side'=>'top', 'padx'=>'.5m', 'pady'=>'.5m')} diff --git a/ext/tk/sample/demos-jp/image2.rb b/ext/tk/sample/demos-jp/image2.rb index 3e8b87461f..aa507c5b9b 100644 --- a/ext/tk/sample/demos-jp/image2.rb +++ b/ext/tk/sample/demos-jp/image2.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # widget demo 'load image' (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($image2_demo) && $image2_demo $image2_demo.destroy $image2_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $image2_demo = TkToplevel.new {|w| title('Image Demonstration #2') iconname("Image2") @@ -18,20 +18,20 @@ $image2_demo = TkToplevel.new {|w| base_frame = TkFrame.new($image2_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "このデモではTkの photo image を使用して画像を見ることができます。最初にエントリ内ににディレクトリ名を入れて下さい。次に下のリストボックスにこのディレクトリをロードするため、リターンを押してください。その後、画像を選択するためにリストボックスの中のファイル名をダブルクリックして下さい。" + text "≪сTk photo image 篏睡糸荀с障潟cャ筝罨<筝鴻鴻c若帥若潟若緇糸御鴻鴻筝<ゃ筝" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $image2_demo $image2_demo = nil @@ -40,20 +40,20 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'image2'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# 変数生成 +# 紊亥 $dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator)) -# image 生成 +# image $image2a = TkPhotoImage.new -# ファイル名入力部 -TkLabel.new(base_frame, 'text'=>'ディレクトリ:')\ +# <ゃュ +TkLabel.new(base_frame, 'text'=>'c:')\ .pack('side'=>'top', 'anchor'=>'w') image2_e = TkEntry.new(base_frame) { @@ -64,7 +64,7 @@ image2_e = TkEntry.new(base_frame) { TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20)\ .pack('side'=>'top', 'anchor'=>'w') -TkLabel.new(base_frame, 'text'=>'ファイル:')\ +TkLabel.new(base_frame, 'text'=>'<ゃ:')\ .pack('side'=>'top', 'anchor'=>'w') TkFrame.new(base_frame){|w| @@ -85,14 +85,14 @@ TkFrame.new(base_frame){|w| }.pack('side'=>'top', 'anchor'=>'w') -# image 配置 +# image 臀 [ TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20), - TkLabel.new(base_frame, 'text'=>'画像:'), + TkLabel.new(base_frame, 'text'=>'糸:'), # TkLabel.new(base_frame, 'image'=>$image2a) Tk::Label.new(base_frame, 'image'=>$image2a) ].each{|w| w.pack('side'=>'top', 'anchor'=>'w')} -# メソッド定義 +# <純絎臂 def loadDir(w) w.delete(0,'end') Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f| diff --git a/ext/tk/sample/demos-jp/image3.rb b/ext/tk/sample/demos-jp/image3.rb index 625e69a21d..5c1ceb2816 100644 --- a/ext/tk/sample/demos-jp/image3.rb +++ b/ext/tk/sample/demos-jp/image3.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # image3.rb # # This demonstration script creates a simple collection of widgets @@ -56,15 +56,15 @@ msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "このデモではTkの photo image を使用して画像を 見ることができます。最初にエントリ内ににディレクトリ名を入れて下さい。次に下のリストボックスにこのディレクトリをロードするため、リターンを押してください。その後、画像を選択するためにリストボックスの中のファイル名をダブルクリックして下さい。" + text "≪сTk photo image 篏睡糸 荀с障潟cャ筝罨<筝鴻鴻c若帥若潟若緇糸御鴻鴻筝<ゃ筝" } msg.pack('side'=>'top') # frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $image3_demo $image3_demo = nil @@ -73,7 +73,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'image3'} }.pack('side'=>'left', 'expand'=>'yes') @@ -92,9 +92,9 @@ $image3a = TkPhotoImage.new # image3_f = TkFrame.new(base_frame).pack(:fill=>:both, :expand=>true) -image3_df = TkLabelFrame.new(base_frame, :text=>'ディレクトリ:') +image3_df = TkLabelFrame.new(base_frame, :text=>'c:') -image3_ff = TkLabelFrame.new(base_frame, :text=>'ファイル:', +image3_ff = TkLabelFrame.new(base_frame, :text=>'<ゃ:', :padx=>'2m', :pady=>'2m') image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) { pack(:side=>:left, :fill=>:y, :expand=>true) @@ -109,12 +109,12 @@ image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){ bind('Return', proc{loadDir3(image3_lbx)}) } -TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"ディレクトリ選択", +TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"c御", :command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) { pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m') } -image3_if = TkLabelFrame.new(base_frame, :text=>'イメージ:') {|f| +image3_if = TkLabelFrame.new(base_frame, :text=>'ゃ<若:') {|f| # TkLabel.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m') Tk::Label.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m') } diff --git a/ext/tk/sample/demos-jp/items.rb b/ext/tk/sample/demos-jp/items.rb index 4440905db8..b1d66f367b 100644 --- a/ext/tk/sample/demos-jp/items.rb +++ b/ext/tk/sample/demos-jp/items.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # canvas item types widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($items_demo) && $items_demo $items_demo.destroy $items_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $items_demo = TkToplevel.new {|w| title("Canvas Item Demonstration") iconname("Items") @@ -18,19 +18,19 @@ $items_demo = TkToplevel.new {|w| base_frame = TkFrame.new($items_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame) { font $font wraplength '5i' justify 'left' - text "このウィンドウにはキャンバス widget が入っており、その中にはキャンバス widget がサポートする様々なタイプのアイテムの例が入っています。次のような操作ができます。\n ボタン-1 ドラッグ:\tアイテムを動かす。\n ボタン-2 ドラッグ:\t見えている部分をずらす。\n ボタン-3 ドラッグ:\t領域を囲う。\n コントロール-F:\t領域の下のアイテムを表示する。" + text "c潟c潟 widget ャc筝c潟 widget 泣若罕帥ゃ≪ゃ箴ャc障罨<篏с障\n 帥-1 :\t≪ゃ\n 帥-2 :\t荀\n 帥-3 :\t蚊\n 潟潟若-F:\t筝≪ゃ茵腓冴" }.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $items_demo $items_demo = nil @@ -39,15 +39,15 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'items'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame cvs = nil TkFrame.new(base_frame) {|cf| - # canvas 生成 + # canvas cvs = TkCanvas.new(cf) {|c| focus scrollregion '0c 0c 30c 24c' @@ -113,11 +113,11 @@ else green = 'black' end -# tag オブジェクトを生成 +# tag 吾с $tag_item = TkcGroup.new(cvs) # Set up demos within each of the areas of the grid. -TkcText.new(cvs, '5c', '.2c', 'text'=>'ライン', 'anchor'=>'n') +TkcText.new(cvs, '5c', '.2c', 'text'=>'ゃ', 'anchor'=>'n') TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c', 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt', 'join'=>'miter', 'tags'=>$tag_item ) @@ -136,7 +136,7 @@ TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c', 'tags'=>$tag_item ) TkcText.new(cvs, '15c', '.2c', - 'text'=>'曲線 (滑らかにつないだ直線)', 'anchor'=>'n') + 'text'=>'牙 (羯ゃ雁)', 'anchor'=>'n') TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c', 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item ) TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c', @@ -148,7 +148,7 @@ TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c', 'images', 'gray25.xbm'].join(File::Separator), 'fill'=>red, 'tags'=>$tag_item ) -TkcText.new(cvs, '25c', '.2c', 'text'=>'多角形', 'anchor'=>'n') +TkcText.new(cvs, '25c', '.2c', 'text'=>'紊茹綵', 'anchor'=>'n') TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c', '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c', 'fill'=>'green', 'outline'=>'black', 'width'=>4, @@ -163,7 +163,7 @@ TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c', 'images', 'gray25.xbm'].join(File::Separator), 'outline'=>'black', 'tags'=>$tag_item ) -TkcText.new(cvs, '5c', '8.2c', 'text'=>'矩形', 'anchor'=>'n') +TkcText.new(cvs, '5c', '8.2c', 'text'=>'綵', 'anchor'=>'n') TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c', 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c', @@ -173,7 +173,7 @@ TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'', 'images','gray25.xbm'].join(File::Separator), 'fill'=>blue, 'tags'=>$tag_item ) -TkcText.new(cvs, '15c', '8.2c', 'text'=>'楕円', 'anchor'=>'n') +TkcText.new(cvs, '15c', '8.2c', 'text'=>'罐', 'anchor'=>'n') TkcOval.new(cvs, '11c','9.5c','14c','12.5c', 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item) TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c', @@ -183,13 +183,13 @@ TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'', 'images','gray25.xbm'].join(File::Separator), 'fill'=>blue, 'tags'=>$tag_item ) -TkcText.new(cvs, '25c', '8.2c', 'text'=>'テキスト', 'anchor'=>'n') +TkcText.new(cvs, '25c', '8.2c', 'text'=>'鴻', 'anchor'=>'n') TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c') TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c', - 'text'=>'短いテキスト。ワードラップ、左揃え、アンカーは北(上)。□は各テキストのアンカーポイントを示す。', 'tags'=>$tag_item ) + 'text'=>'鴻若綏≪潟若(筝)<鴻≪潟若ゃ潟腓冴', 'tags'=>$tag_item ) TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c') TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue, - 'text'=>"いくつかの行。\nそれぞれ独立に\n行揃え。\n全て左端がアンカーされている。", 'justify'=>'center', 'tags'=>$tag_item ) + 'text'=>"ゃ茵\n腴\n茵\n綏腴≪潟若", 'justify'=>'center', 'tags'=>$tag_item ) TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c') if $tk_version =~ /^4\.[01]/ TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red, @@ -202,7 +202,7 @@ else 'tags'=>$tag_item ) end -TkcText.new(cvs, '5c', '16.2c', 'text'=>'弧', 'anchor'=>'n') +TkcText.new(cvs, '5c', '16.2c', 'text'=>'綣', 'anchor'=>'n') TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black', 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item) #TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc', @@ -221,7 +221,7 @@ TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord', 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270, 'tags'=>$tag_item) -TkcText.new(cvs, '15c', '16.2c', 'text'=>'ビットマップ', 'anchor'=>'n') +TkcText.new(cvs, '15c', '16.2c', 'text'=>'', 'anchor'=>'n') #TkcBitmap.new(cvs, '13c','20c', # 'bitmap'=>'@' + ['images', 'face'].join(File::Separator), # 'tags'=>$tag_item) @@ -239,7 +239,7 @@ TkcBitmap.new(cvs, '17c','18.5c', #TkcBitmap.new(cvs, '17c','21.5c', # 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator), # 'tags'=>$tag_item) -# ↓の形式でも可能 +# 綵√с TkcBitmap.new(cvs, '17c','21.5c') { bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator) tags $tag_item @@ -249,15 +249,15 @@ TkcBitmap.new(cvs, '17c','21.5c') { # tags $tag_item #} -TkcText.new(cvs, '25c', '16.2c', 'text'=>'ウィンドウ', 'anchor'=>'n') +TkcText.new(cvs, '25c', '16.2c', 'text'=>'c潟', 'anchor'=>'n') TkButton.new(cvs) {|b| - text '押してね' + text '若' command proc{butPress cvs, red} TkcWindow.new(cvs, '21c','18c', 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item) } TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e| - insert 'end', '編集してね' + insert 'end', '膩' TkcWindow.new(cvs, '21c','21c', 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item) } @@ -266,9 +266,9 @@ TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c', TkcWindow.new(cvs, '28.5c','17.5c', 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item) } -TkcText.new(cvs, '21c', '17.9c', 'text'=>'ボタン:', 'anchor'=>'sw') -TkcText.new(cvs, '21c', '20.9c', 'text'=>'エントリ:', 'anchor'=>'sw') -TkcText.new(cvs, '28.5c', '17.4c', 'text'=>'スケール:', 'anchor'=>'s') +TkcText.new(cvs, '21c', '17.9c', 'text'=>'帥:', 'anchor'=>'sw') +TkcText.new(cvs, '21c', '20.9c', 'text'=>'潟:', 'anchor'=>'sw') +TkcText.new(cvs, '28.5c', '17.4c', 'text'=>'鴻宴若:', 'anchor'=>'s') # Set up event bindings for canvas: cvs.itembind($tag_item, 'Any-Enter', proc{itemEnter cvs}) @@ -374,6 +374,6 @@ end def butPress(w,color) i = TkcText.new(w, '25c', '18.1c', - 'text'=>'いてて!!', 'fill'=>color, 'anchor'=>'n') + 'text'=>'!!', 'fill'=>color, 'anchor'=>'n') Tk.after(500, proc{w.delete i}) end diff --git a/ext/tk/sample/demos-jp/ixset2 b/ext/tk/sample/demos-jp/ixset2 index 5011dfe640..e11ce2ac8f 100644 --- a/ext/tk/sample/demos-jp/ixset2 +++ b/ext/tk/sample/demos-jp/ixset2 @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # ixset -- # A nice interface to "xset" to change X server settings @@ -167,15 +167,15 @@ class Xsettings btn_frame = TkFrame.new(@root) buttons = [ @btn_OK = TkButton.new(btn_frame, 'command'=>proc{win.ok}, - 'default'=>'active', 'text'=>'了解'), + 'default'=>'active', 'text'=>'篋茹'), @btn_APPLY = TkButton.new(btn_frame, 'command'=>proc{win.writesettings}, - 'default'=>'normal', 'text'=>'適用', + 'default'=>'normal', 'text'=>'', 'state'=>'disabled'), @btn_CANCEL = TkButton.new(btn_frame, 'command'=>proc{win.cancel}, - 'default'=>'normal', 'text'=>'取消', + 'default'=>'normal', 'text'=>'羔', 'state'=>'disabled'), @btn_QUIT = TkButton.new(btn_frame, 'command'=>proc{win.quit}, - 'default'=>'normal', 'text'=>'中止') + 'default'=>'normal', 'text'=>'筝罩') ] buttons.each{|b| b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5) } @@ -202,16 +202,16 @@ class Xsettings # # Bell settings # - bell = TkLabelframe.new(@root, 'text'=>'ベル設定', + bell = TkLabelframe.new(@root, 'text'=>'荐絎', 'padx'=>'1.5m', 'pady'=>'1.5m') @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200, 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>"音量 (%)") + 'label'=>"渇 (%)") f = TkFrame.new(bell) - @w_bellpit = LabelEntry.new(f, "音程 (Hz)", 6, [25, 20000]) + @w_bellpit = LabelEntry.new(f, "括 (Hz)", 6, [25, 20000]) @w_bellpit.pack('side'=>'left', 'padx'=>5) - @w_belldur = LabelEntry.new(f, "持続時間 (ms)", 6, [1, 10000]) + @w_belldur = LabelEntry.new(f, "膓 (ms)", 6, [1, 10000]) @w_belldur.pack('side'=>'right', 'padx'=>5) @w_bellvol.pack('side'=>'top', 'expand'=>'yes') @@ -222,10 +222,10 @@ class Xsettings # kbdonoff = nil kbdcli = nil - kbd = TkLabelframe.new(@root, 'text'=>'キーボードリピート設定', + kbd = TkLabelframe.new(@root, 'text'=>'若若若荐絎', 'padx'=>'1.5m', 'pady'=>'1.5m') f = TkFrame.new(kbd) - @w_kbdonoff = TkCheckButton.new(f, 'text'=>'クリック音あり', + @w_kbdonoff = TkCheckButton.new(f, 'text'=>'潟', 'relief'=>'flat', 'onvalue'=>'on', 'offvalue'=>'off', 'variable'=>@w_kbdrep ) { @@ -240,7 +240,7 @@ class Xsettings } @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200, 'tickinterval'=>20, 'orient'=>'horizontal', - 'label'=>'クリック音量 (%)') + 'label'=>'渇 (%)') @w_kbdcli.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x', 'padx'=>['1m', 0]) f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x') @@ -248,21 +248,21 @@ class Xsettings # # Mouse settings # - mouse = TkLabelframe.new(@root, 'text'=>'マウス設定', + mouse = TkLabelframe.new(@root, 'text'=>'壕┃絎', 'padx'=>'1.5m', 'pady'=>'1.5m') f = TkFrame.new(mouse) - @w_mouseacc = LabelEntry.new(f, '加速量', 5) + @w_mouseacc = LabelEntry.new(f, '', 5) @w_mouseacc.pack('side'=>'left', 'padx'=>[0, '1m']) - @w_mousethr = LabelEntry.new(f, '閾値 (pixels)', 3, [1, 2000]) + @w_mousethr = LabelEntry.new(f, '上 (pixels)', 3, [1, 2000]) @w_mousethr.pack('side'=>'right', 'padx'=>['1m', 0]) f.pack('side'=>'top', 'expand'=>'yes') # # Screen Saver settings # - screen = TkLabelframe.new(@root, 'text'=>'スクリーンセーバ設定', + screen = TkLabelframe.new(@root, 'text'=>'鴻若潟祉若荐絎', 'padx'=>'1.5m', 'pady'=>'1.5m') - @w_screenblank = TkRadioButton.new(screen, 'text'=>'ブランク表示', + @w_screenblank = TkRadioButton.new(screen, 'text'=>'潟茵腓', 'relief'=>'flat', 'anchor'=>'w', 'variable'=>@w_screenbla, 'value'=>'blank') { @@ -275,7 +275,7 @@ class Xsettings end } - @w_screenpat = TkRadioButton.new(screen, 'text'=>'パターン表示', + @w_screenpat = TkRadioButton.new(screen, 'text'=>'帥若活;腓', 'relief'=>'flat', 'anchor'=>'w', 'variable'=>@w_screenbla, 'value'=>'noblank') { @@ -288,8 +288,8 @@ class Xsettings end } - @w_screentim = LabelEntry.new(screen, 'タイムアウト (s)', 5, [1, 100000]) - @w_screencyc = LabelEntry.new(screen, '周期 (s)', 5, [1, 100000]) + @w_screentim = LabelEntry.new(screen, '帥ゃ≪ (s)', 5, [1, 100000]) + @w_screencyc = LabelEntry.new(screen, ' (s)', 5, [1, 100000]) Tk.grid(@w_screenblank, @w_screentim, 'sticky'=>'e') Tk.grid(@w_screenpat, @w_screencyc, 'sticky'=>'e') diff --git a/ext/tk/sample/demos-jp/knightstour.rb b/ext/tk/sample/demos-jp/knightstour.rb index ae0f13076e..835a24c392 100644 --- a/ext/tk/sample/demos-jp/knightstour.rb +++ b/ext/tk/sample/demos-jp/knightstour.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # Based on the widget demo of Tcl/Tk8.5.2 # The following is the original copyright text. @@ -94,13 +94,13 @@ class Knights_Tour @start_btn.state :normal if @visited.length == 64 if @initial == square - @log.insert :end, '周遊(closed tour)成功!' + @log.insert :end, '(closed tour)鐚' else - @log.insert :end, "成功\n", {} + @log.insert :end, "\n", {} Tk.after(@delay.numeric * 2){tour(rand(64))} if @continuous.bool end else - @log.insert :end, "失敗!\n", {} + @log.insert :end, "紊掩鐚\n", {} end end end @@ -158,10 +158,10 @@ class Knights_Tour sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'knightstour'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $knightstour.destroy @@ -187,14 +187,14 @@ class Knights_Tour @continuous = TkVariable.new(false) tool_f = Ttk::Frame.new($knightstour) - label = Ttk::Label.new(tool_f, :text=>'実行速度') + label = Ttk::Label.new(tool_f, :text=>'絎茵綺') scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay, :command=>proc{|n| set_delay(n)}) - check = Ttk::Checkbutton.new(tool_f, :text=>'反復', + check = Ttk::Checkbutton.new(tool_f, :text=>'緇', :variable=>@continuous) - @start_btn = Ttk::Button.new(tool_f, :text=>'開始', + @start_btn = Ttk::Button.new(tool_f, :text=>'紮', :command=>proc{tour()}) - @exit_btn = Ttk::Button.new(tool_f, :text=>'終了', + @exit_btn = Ttk::Button.new(tool_f, :text=>'腟篋', :command=>proc{_exit()}) 7.downto(0){|row| diff --git a/ext/tk/sample/demos-jp/label.rb b/ext/tk/sample/demos-jp/label.rb index 19105e6f71..700e6a61ce 100644 --- a/ext/tk/sample/demos-jp/label.rb +++ b/ext/tk/sample/demos-jp/label.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # label widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($label_demo) && $label_demo $label_demo.destroy $label_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $label_demo = TkToplevel.new {|w| title("Label Demonstration") iconname("label") @@ -18,20 +18,20 @@ $label_demo = TkToplevel.new {|w| base_frame = TkFrame.new($label_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下には5つのラベルが表示されています。左側にはテキストラベルが3つあり、右側にはビットマップラベルとテキストラベルがあります。ラベルというのはあまり面白いものではありません。なぜなら眺める以外何もできないからです。" + text "筝5ゃ茵腓冴障綏眼鴻3ゃ勀眼鴻障障∝純с障冴篁ュ篏сс" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $label_demo $label_demo = nil @@ -40,23 +40,23 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'label'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# label demo 用フレーム生成 +# label demo 若 f_left = TkFrame.new(base_frame) f_right = TkFrame.new(base_frame) [f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes', 'padx'=>10, 'pady'=>10, 'fill'=>'both')} -# label 生成 -[ TkLabel.new(f_left, 'text'=>'最初のラベル'), - TkLabel.new(f_left, 'text'=>'2 番目。ちょっと浮き上がらせてみました', +# label +[ TkLabel.new(f_left, 'text'=>''), + TkLabel.new(f_left, 'text'=>'2 <c羌筝帥障', 'relief'=>'raised'), - TkLabel.new(f_left, 'text'=>'3 番目。沈んでいます ', 'relief'=>'sunken') + TkLabel.new(f_left, 'text'=>'3 羃с障 ', 'relief'=>'sunken') ].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')} # TkLabel.new(f_right) { @@ -66,4 +66,4 @@ Tk::Label.new(f_right) { relief 'sunken' }.pack('side'=>'top') -TkLabel.new(f_right) { text 'Tcl/Tk 所有者' }.pack('side'=>'top') +TkLabel.new(f_right) { text 'Tcl/Tk ' }.pack('side'=>'top') diff --git a/ext/tk/sample/demos-jp/labelframe.rb b/ext/tk/sample/demos-jp/labelframe.rb index cee504f4b6..80e106c6e7 100644 --- a/ext/tk/sample/demos-jp/labelframe.rb +++ b/ext/tk/sample/demos-jp/labelframe.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # labelframe.rb # @@ -25,28 +25,28 @@ base_frame = TkFrame.new($labelframe_demo).pack(:fill=>:both, :expand=>true) TkLabel.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) -TkLabelFrame ウィジェットは関連する widget -群をまとめて取り扱うために用いられます。ラ -ベルは通常の文字列でも何らかのウィジェット -でもかまいません。もしあなたが使っている -Ruby にリンクされている Tk ライブラリが -labelframe ウィジェットを実装していない -場合、このデモはうまく動かないはずです。 -その場合には labelframe ウィジェットが実装 -されているようなより新しいバージョンの Tk -を組み合わせて試すようにしてください。 +TkLabelFrame c吾с∫c widget +臂ゃ障宴障 +絽吾絖с篏c吾с +с障障篏帥c +Ruby 潟 Tk ゃ +labelframe c吾с絎茖 +翫≪障с +翫 labelframe c吾с絎茖 +違若吾с潟 Tk +腟水荅 EOL # The bottom buttons TkFrame.new(base_frame){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'', :width=>15, :command=>proc{ $labelframe_demo.destroy $labelframe_demo = nil }).pack(:side=>:left, :expand=>true) - TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'潟若', :width=>15, :command=>proc{ showCode 'labelframe' }).pack(:side=>:left, :expand=>true) } @@ -56,7 +56,7 @@ w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both, :expand=>true) # A group of radiobuttons in a labelframe -TkLabelFrame.new(w, :text=>'選択値', +TkLabelFrame.new(w, :text=>'御', :padx=>2, :pady=>2) {|f| grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m') @@ -86,13 +86,13 @@ end TkLabelFrame.new(w, :pady=>2, :padx=>2){|f| TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy, - :text=>"オプションを使用", :padx=>0) {|cb| + :text=>"激с潟篏睡", :padx=>0) {|cb| command proc{lfEnableButtons(f)} f.labelwidget(cb) } grid(:row=>0, :column=>1, :pady=>'2m', :padx=>'2m') - %w(オプション1 オプション2 オプション3).each{|str| + %w(激с1 激с2 激с3).each{|str| TkCheckbutton.new(f, :text=>str).pack(:side=>:top, :fill=>:x, :pady=>2) } diff --git a/ext/tk/sample/demos-jp/mclist.rb b/ext/tk/sample/demos-jp/mclist.rb index 37f5dfa8eb..67cec638eb 100644 --- a/ext/tk/sample/demos-jp/mclist.rb +++ b/ext/tk/sample/demos-jp/mclist.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # mclist.rb -- # @@ -24,16 +24,16 @@ base_frame = TkFrame.new($mclist_demo).pack(:fill=>:both, :expand=>true) Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], :text=><:x) -Ttkとは,テーマ指定可能な新しいウィジェット集合です.\ -Ttk::Treeviewウィジェットは\ -Ttkウィジェットセットに含まれるウィジェットの一つで,\ -それが保持する木構造のデータそのものまでは表示することなく,\ -示したい情報をマルチカラムで表示させることができます. -このサンプルは,複数のカラムを持ったリストボックスを作成する簡単な例です. -各カラムのタイトル(heading)をクリックすれば,\ -そのカラムの情報に基づいてリストの並べ替えがなされるはずです.\ -また,カラムのタイトル間の区切り部分をドラッグすることで,\ -カラムの幅を変更することも可能です. +Ttk鐚若絎純違c吾сс鐚\ +Ttk::Treeviewc吾с\ +Ttkc吾с祉障c吾с筝ゃэ\ +篆罕若帥障с茵腓冴鐚\ +腓冴宴ц;腓冴с障鐚 +泣潟鐚茲違c鴻鴻篏膂≦箴с鐚 +帥ゃ(heading)逸\ +宴冴ャ鴻筝号帥с鐚\ +障鐚帥ゃ阪違э\ +綛紊眼純с鐚 EOL ## See Code / Dismiss @@ -41,10 +41,10 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'mclist'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $mclist_demo.destroy @@ -74,27 +74,27 @@ container.grid_rowconfigure(0, :weight=>1) ## The data we're going to insert data = [ - ['アルゼンチン', 'ブエノスアイレス', 'ARS'], - ['オーストラリア', 'キャンベラ', 'AUD'], - ['ブラジル', 'ブラジリア', 'BRL'], - ['カナダ', 'オタワ', 'CAD'], - ['中国', '北京', 'CNY'], - ['フランス', 'パリ', 'EUR'], - ['ドイツ', 'ベルリン', 'EUR'], - ['インド', 'ニューデリー', 'INR'], - ['イタリア', 'ローマ', 'EUR'], - ['日本', '東京', 'JPY'], - ['メキシコ', 'メキシコシティ', 'MXN'], - ['ロシア', 'モスクワ', 'RUB'], - ['南アフリカ', 'プレトリア', 'ZAR'], - ['英国', 'ロンドン', 'GBP'], - ['アメリカ', 'ワシントン D.C.', 'USD'], + ['≪若潟', '鴻≪ゃ', 'ARS'], + ['若鴻', 'c潟', 'AUD'], + ['吾', '吾', 'BRL'], + ['', '帥', 'CAD'], + ['筝', '篋', 'CNY'], + ['潟', '', 'EUR'], + ['ゃ', '', 'EUR'], + ['ゃ潟', 'ャ若', 'INR'], + ['ゃ帥', '若', 'EUR'], + ['ユ', '延根', 'JPY'], + ['<激', '<激潟激', 'MXN'], + ['激', '≪鴻', 'RUB'], + ['≪', '', 'ZAR'], + ['怨', '潟', 'GBP'], + ['≪<', '激潟 D.C.', 'USD'], ] ## Code to insert the data nicely font = Ttk::Style.lookup(tree[:style], :font) cols = %w(country capital currency) -cols.zip(%w(国名 首都 通貨)).each{|col, name| +cols.zip(%w(遵 薤 莢)).each{|col, name| tree.heading_configure(col, :text=>name, :command=>proc{sort_by(tree, col, false)}) tree.column_configure(col, :width=>TkFont.measure(font, name)) diff --git a/ext/tk/sample/demos-jp/menu.rb b/ext/tk/sample/demos-jp/menu.rb index e38a467000..05ea7a9ec2 100644 --- a/ext/tk/sample/demos-jp/menu.rb +++ b/ext/tk/sample/demos-jp/menu.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # menus widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($menu_demo) && $menu_demo $menu_demo.destroy $menu_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $menu_demo = TkToplevel.new {|w| title("File Selection Dialogs") iconname("menu") @@ -18,7 +18,7 @@ $menu_demo = TkToplevel.new {|w| base_frame = TkFrame.new($menu_demo).pack(:fill=>:both, :expand=>true) -# menu frame 生成 +# menu frame $menu_frame = TkFrame.new(base_frame, 'relief'=>'raised', 'bd'=>2) $menu_frame.pack('side'=>'top', 'fill'=>'x') @@ -28,21 +28,21 @@ rescue windowingsystem = "" end -# label 生成 +# label TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { if $tk_platform['platform'] == 'macintosh' || windowingsystem == "classic" || windowingsystem == "aqua" - text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Command-X を入力すると、Xがコマンドキー記号に続いて表示されている文字ならば、アクセラレータを使った項目起動を行うことができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。") + text("c潟罕<ャ若鴻宴若<ャ若罕障Command-X ュX潟潟取垩膓茵腓冴絖違≪祉若帥篏帥c莎桁茵с障<ャ取膣筝緇<ャ若御х腴с障") else - text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Alt-X を入力すると、Xがメニューにアンダーライン付きで表示されている文字ならば、キーボードからの指定ができます。矢印キーでメニューのトラバースも可能です。メニューが指定された際には、スペースキーで実行することができます。あるいは、アンダーライン付きの文字を入力することでも実行できます。メニューのエントリがアクセラレータを持っている場合は、そのアクセラレータを入力することでメニューを指定することなしに実行することができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。") + text("c潟罕<ャ若鴻宴若<ャ若罕障Alt-X ュX<ャ若≪潟若ゃ割ц;腓冴絖違若若絎с障√違若с<ャ若若鴻純с<ャ若絎鴻若鴻若у茵с障≪潟若ゃ割絖ュс絎茵с障<ャ若潟≪祉若帥c翫≪祉若帥ュс<ャ若絎絎茵с障<ャ取膣筝緇<ャ若御х腴с障") end }.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $menu_demo $menu_demo = nil @@ -51,25 +51,25 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'menu'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# menu 生成 +# menu TkMenubutton.new($menu_frame, 'text'=>'File', 'underline'=>0) {|m| pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|file_menu| m.configure('menu'=>file_menu) - add('command', 'label'=>'開く ...', 'command'=>proc{fail 'これは、デモですので"開く ..."に対するアクションは定義されていません。'}) - add('command', 'label'=>'新規', 'command'=>proc{fail 'これは、デモですので"新規"に対するアクションは定義されていません。'}) - add('command', 'label'=>'保存', 'command'=>proc{fail 'これは、デモですので"保存"に対するアクションは定義されていません。'}) - add('command', 'label'=>'保存(指定) ...', 'command'=>proc{fail 'これは、デモですので"保存(指定) ..."に対するアクションは定義されていません。'}) + add('command', 'label'=>' ...', 'command'=>proc{fail '≪с" ..."絲障≪激с潟絎臂障'}) + add('command', 'label'=>'域', 'command'=>proc{fail '≪с"域"絲障≪激с潟絎臂障'}) + add('command', 'label'=>'篆絖', 'command'=>proc{fail '≪с"篆絖"絲障≪激с潟絎臂障'}) + add('command', 'label'=>'篆絖(絎) ...', 'command'=>proc{fail '≪с"篆絖(絎) ..."絲障≪激с潟絎臂障'}) add('separator') - add('command', 'label'=>'プリント設定 ...', 'command'=>proc{fail 'これは、デモですので"プリント設定 ..."に対するアクションは定義されていません。'}) - add('command', 'label'=>'プリント ...', 'command'=>proc{fail 'これは、デモですので"プリント ..."に対するアクションは定義されていません。'}) + add('command', 'label'=>'潟荐絎 ...', 'command'=>proc{fail '≪с"潟荐絎 ..."絲障≪激с潟絎臂障'}) + add('command', 'label'=>'潟 ...', 'command'=>proc{fail '≪с"潟 ..."絲障≪激с潟絎臂障'}) add('separator') - add('command', 'label'=>'終了', 'command'=>proc{$menu_demo.destroy}) + add('command', 'label'=>'腟篋', 'command'=>proc{$menu_demo.destroy}) } } @@ -86,10 +86,10 @@ TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m| pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|basic_menu| m.configure('menu'=>basic_menu) - add('command', 'label'=>'何もしない長いエントリ') + add('command', 'label'=>'篏激潟') ['A','B','C','D','E','F','G'].each{|c| - # add('command', 'label'=>"文字 \"#{c}\" を印字", 'underline'=>4, - add('command', 'label'=>"Print letter \"#{c}\" (文字 \"#{c}\" を印字)", + # add('command', 'label'=>"絖 \"#{c}\" 医", 'underline'=>4, + add('command', 'label'=>"Print letter \"#{c}\" (絖 \"#{c}\" 医)", 'underline'=>14, 'accelerator'=>"Meta+#{c}", 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) @@ -101,58 +101,58 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m| pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| m.configure('menu'=>cascade_menu) - add('command', 'label'=>'Print hello(こんにちは)', - 'command'=>proc{print "Hello(こんにちは)\n"}, + add('command', 'label'=>'Print hello(<)', + 'command'=>proc{print "Hello(<)\n"}, 'accelerator'=>"#{modifier}+H", 'underline'=>6) - $menu_demo.bind("#{modifier}-h", proc{print "Hello(こんにちは)\n"}) - add('command', 'label'=>'Print goodbye(さようなら)', - 'command'=>proc{print "Goodbye(さようなら)\n"}, + $menu_demo.bind("#{modifier}-h", proc{print "Hello(<)\n"}) + add('command', 'label'=>'Print goodbye()', + 'command'=>proc{print "Goodbye()\n"}, 'accelerator'=>"#{modifier}+G", 'underline'=>6) - $menu_demo.bind("#{modifier}-g", proc{print "Goodbye(さようなら)\n"}) + $menu_demo.bind("#{modifier}-g", proc{print "Goodbye()\n"}) # TkMenu.new(m, 'tearoff'=>false) {|cascade_check| TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_check| - cascade_menu.add('cascade', 'label'=>'Check buttons(チェックボタン)', + cascade_menu.add('cascade', 'label'=>'Check buttons(с帥)', 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) - add('check', 'label'=>'オイル点検', 'variable'=>oil) + add('check', 'label'=>'ゃ号', 'variable'=>oil) trans = TkVariable.new(0) - add('check', 'label'=>'トランスミッション点検', 'variable'=>trans) + add('check', 'label'=>'潟鴻激с括号', 'variable'=>trans) brakes = TkVariable.new(0) - add('check', 'label'=>'ブレーキ点検', 'variable'=>brakes) + add('check', 'label'=>'若号', 'variable'=>brakes) lights = TkVariable.new(0) - add('check', 'label'=>'ライト点検', 'variable'=>lights) + add('check', 'label'=>'ゃ号', 'variable'=>lights) add('separator') - add('command', 'label'=>'現在の値を表示', + add('command', 'label'=>'憜ゃ茵腓', 'command'=>proc{showVars($menu_demo, - ['オイル点検', oil], - ['トランスミッション点検', trans], - ['ブレーキ点検', brakes], - ['ライト点検', lights])} ) + ['ゃ号', oil], + ['潟鴻激с括号', trans], + ['若号', brakes], + ['ゃ号', lights])} ) invoke 1 invoke 3 } #TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_radio| - cascade_menu.add('cascade', 'label'=>'Radio buttons(ラジオボタン)', + cascade_menu.add('cascade', 'label'=>'Radio buttons(吾帥)', 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new - add('radio', 'label'=>'10 ポイント', 'variable'=>pointSize, 'value'=>10) - add('radio', 'label'=>'14 ポイント', 'variable'=>pointSize, 'value'=>14) - add('radio', 'label'=>'18 ポイント', 'variable'=>pointSize, 'value'=>18) - add('radio', 'label'=>'24 ポイント', 'variable'=>pointSize, 'value'=>24) - add('radio', 'label'=>'32 ポイント', 'variable'=>pointSize, 'value'=>32) + add('radio', 'label'=>'10 ゃ潟', 'variable'=>pointSize, 'value'=>10) + add('radio', 'label'=>'14 ゃ潟', 'variable'=>pointSize, 'value'=>14) + add('radio', 'label'=>'18 ゃ潟', 'variable'=>pointSize, 'value'=>18) + add('radio', 'label'=>'24 ゃ潟', 'variable'=>pointSize, 'value'=>24) + add('radio', 'label'=>'32 ゃ潟', 'variable'=>pointSize, 'value'=>32) add('separator') style = TkVariable.new - add('radio', 'label'=>'ローマン', 'variable'=>style, 'value'=>'roman') - add('radio', 'label'=>'ボールド', 'variable'=>style, 'value'=>'bold') - add('radio', 'label'=>'イタリック', 'variable'=>style, 'value'=>'italic') + add('radio', 'label'=>'若', 'variable'=>style, 'value'=>'roman') + add('radio', 'label'=>'若', 'variable'=>style, 'value'=>'bold') + add('radio', 'label'=>'ゃ帥', 'variable'=>style, 'value'=>'italic') add('separator') - add('command', 'label'=>'現在の値を表示', + add('command', 'label'=>'憜ゃ茵腓', 'command'=>proc{showVars($menu_demo, - ['ポイントサイズ', pointSize], - ['スタイル', style])} ) + ['ゃ潟泣ゃ', pointSize], + ['鴻帥ゃ', style])} ) invoke 1 invoke 7 } @@ -167,9 +167,9 @@ TkMenubutton.new($menu_frame, 'text'=>'Icons', 'underline'=>0) {|m| 'bitmap'=>'@'+[$demo_dir,'..', 'images','pattern.xbm'].join(File::Separator), 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。', + 'text'=>'篁御<ャ若鴻с茵腓冴障篁ュ鴻с篁<ャ守紊障', 'bitmap'=>'', 'default'=>0, - 'buttons'=>'了解')} ) + 'buttons'=>'篋茹')} ) ['info', 'questhead', 'error'].each{|icon| add('command', 'bitmap'=>icon, 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) @@ -181,8 +181,8 @@ TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m| pack('side'=>'left') TkMenu.new(m, 'tearoff'=>false) {|more_menu| m.configure('menu'=>more_menu) - [ 'エントリ','別のエントリ','何もしない','ほとんど何もしない', - '人生を意義あるものに' ].each{|i| + [ '潟','ャ潟','篏','祉篏', + '篋榊靸' ].each{|i| add('command', 'label'=>i, 'command'=>proc{print "You invoked \"#{i}\"\n"}) } diff --git a/ext/tk/sample/demos-jp/menu84.rb b/ext/tk/sample/demos-jp/menu84.rb index 094853a728..6a57279481 100644 --- a/ext/tk/sample/demos-jp/menu84.rb +++ b/ext/tk/sample/demos-jp/menu84.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # menus widget demo (called by 'widget') # @@ -28,9 +28,9 @@ end TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { if $tk_platform['platform'] == 'macintosh' || windowingsystem == "classic" || windowingsystem == "aqua" - text("このウィンドウにはカスケードメニューを持つメニューバーが付けられています。Command+x ('x'はコマンドキーシンボルに続けて表示されている文字です) とタイプすることによっても項目の機能を呼び出すことができます。最後のメニューは、マウスでウィンドウの外にドラッグすることによって、独立したパレットとなるように切り放すことが可能です。") + text("c潟鴻宴若<ャ若ゃ<ャ若若篁障Command+x ('x'潟潟若激潟膓茵腓冴絖с) 帥ゃc罘純若喝冴с障緇<ャ若鴻сc潟紊違c腴障純с") else - text("このウィンドウにはカスケードメニューを持つメニューバーが付けられています。Alt+x ('x'はメニュー上で下線が引かれた文字です) とタイプすることによってもメニューを呼び出すことができます。矢印キーを使って、メニュー間を移動することも可能です。メニューが表示されている時には、現在位置の項目をスペースキーで選択したり、下線が引かれた文字を入力することでその項目を選択したりすることができます。もし項目にアクセラレータの指定がなされていたならば、その指定されたキー入力を行うことで、メニューを表示させることなく直接その項目の機能を呼び出せます。最後のメニューは、メニューの最初の項目を選択することによって、独立したパレットとなるように切り放すことが可能です。") + text("c潟鴻宴若<ャ若ゃ<ャ若若篁障Alt+x ('x'<ャ寂т膩綣絖с) 帥ゃc<ャ若若喝冴с障√違若篏帥c<ャ守腱糸純с<ャ若茵腓冴憜篏臀鴻若鴻若ч御筝膩綣絖ュс御с障≪祉若帥絎違絎弱ュ茵с<ャ若茵腓冴贋・罘純若喝冴障緇<ャ若<ャ若御c腴障純с") end }.pack('side'=>'top') @@ -48,8 +48,8 @@ TkFrame.new(base_frame) {|frame| # frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $menu84_demo $menu84_demo = nil @@ -58,7 +58,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'menu84'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') @@ -70,13 +70,13 @@ $menu84_frame = TkMenu.new($menu84_demo, 'tearoff'=>false) # menu TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| $menu84_frame.add('cascade', 'label'=>'File', 'menu'=>m, 'underline'=>0) - add('command', 'label'=>'Open...', 'command'=>proc{fail 'これは単なるデモですから、"Open..." 項目の機能は特に定義されてはいません。'}) - add('command', 'label'=>'New', 'command'=>proc{fail 'これは単なるデモですから、"New" 項目の機能は特に定義されてはいません。'}) - add('command', 'label'=>'Save', 'command'=>proc{fail 'これは単なるデモですから、"Save" 項目の機能は特に定義されてはいません。'}) - add('command', 'label'=>'Save As...', 'command'=>proc{fail 'これは単なるデモですから、"Save As..." 項目の機能は特に定義されてはいません。'}) + add('command', 'label'=>'Open...', 'command'=>proc{fail '≪с"Open..." 罘純鴻絎臂障'}) + add('command', 'label'=>'New', 'command'=>proc{fail '≪с"New" 罘純鴻絎臂障'}) + add('command', 'label'=>'Save', 'command'=>proc{fail '≪с"Save" 罘純鴻絎臂障'}) + add('command', 'label'=>'Save As...', 'command'=>proc{fail '≪с"Save As..." 罘純鴻絎臂障'}) add('separator') - add('command', 'label'=>'Print Setup...', 'command'=>proc{fail 'これは単なるデモですから、"Print Setup..." 項目の機能は特に定義されてはいません。'}) - add('command', 'label'=>'Print...', 'command'=>proc{fail 'これは単なるデモですから、"Print..." 項目の機能は特に定義されてはいません。'}) + add('command', 'label'=>'Print Setup...', 'command'=>proc{fail '≪с"Print Setup..." 罘純鴻絎臂障'}) + add('command', 'label'=>'Print...', 'command'=>proc{fail '≪с"Print..." 罘純鴻絎臂障'}) add('separator') add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu84_demo.destroy}) } @@ -116,20 +116,20 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| m.add('cascade', 'label'=>'Check button', 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) - add('check', 'label'=>'オイル検査', 'variable'=>oil) + add('check', 'label'=>'ゃ罎', 'variable'=>oil) trans = TkVariable.new(0) - add('check', 'label'=>'トランスミッション検査', 'variable'=>trans) + add('check', 'label'=>'潟鴻激с恰', 'variable'=>trans) brakes = TkVariable.new(0) - add('check', 'label'=>'ブレーキ検査', 'variable'=>brakes) + add('check', 'label'=>'若罎', 'variable'=>brakes) lights = TkVariable.new(0) - add('check', 'label'=>'ライト検査', 'variable'=>lights) + add('check', 'label'=>'ゃ罎', 'variable'=>lights) add('separator') add('command', 'label'=>'Show current values', 'command'=>proc{showVars($menu84_demo, - ['オイル', oil], - ['トランスミッション', trans], - ['ブレーキ', brakes], - ['ライト', lights])} ) + ['ゃ', oil], + ['潟鴻激с', trans], + ['若', brakes], + ['ゃ', lights])} ) invoke 1 invoke 3 } @@ -149,7 +149,7 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold') add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') add('separator') - add('command', 'label'=>'現在値の表示', + add('command', 'label'=>'憜ゃ茵腓', 'command'=>proc{showVars($menu84_demo, ['pointSize', pointSize], ['style', style])} ) @@ -164,9 +164,9 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| 'bitmap'=>'@'+[$demo_dir,'..', 'images','pattern.xbm'].join(File::Separator), 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'あなたが選択したメニュー項目は、文字列の代わりにビットマップイメージで項目を表示したものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', + 'text'=>'御<ャ守絖篁cゃ<若吾ч茵腓冴с篁ュ鴻с祉<ャ守х鴻с障', 'bitmap'=>'', 'default'=>0, - 'buttons'=>'閉じる')} ) + 'buttons'=>'')} ) ['info', 'questhead', 'error'].each{|icon| add('command', 'bitmap'=>icon, 'hidemargin'=>1, 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) @@ -187,8 +187,8 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| 'bitmap'=>'questhead', 'compound'=>'left', 'command'=>proc{ TkDialog.new('title'=>'Compound Menu Entry', - 'message'=>'あなたが選択したメニュー項目は、ビットマップイメージと文字列とを同時に一つの項目に表示するようにしたものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', - 'buttons'=>['了解'], 'bitmap'=>'') + 'message'=>'御<ャ守ゃ<若吾絖筝ゃ茵腓冴с篁ュ鴻с祉<ャ守х鴻с障', + 'buttons'=>['篋茹'], 'bitmap'=>'') }) } diff --git a/ext/tk/sample/demos-jp/menu8x.rb b/ext/tk/sample/demos-jp/menu8x.rb index 49aca6786d..77ecb5bcf3 100644 --- a/ext/tk/sample/demos-jp/menu8x.rb +++ b/ext/tk/sample/demos-jp/menu8x.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # menus widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($menu8x_demo) && $menu8x_demo $menu8x_demo.destroy $menu8x_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $menu8x_demo = TkToplevel.new {|w| title("Menu Demonstration (Tk8.x)") iconname("menu") @@ -21,16 +21,16 @@ base_frame = TkFrame.new($menu8x_demo).pack(:fill=>:both, :expand=>true) # version check if $tk_version.to_f < 8.0 -# label 生成 +# label TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - text("実行しようとしたスクリプトは Tk8.0 以上で利用できる機能を利用しているため、あなたの Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} では正常に実行できません。よってデモの実行を中止しました。ただし、下のコード参照ボタンを押すことで、実行が中止されたスクリプトのソースを参照することは可能です。") + text("絎茵鴻 Tk8.0 篁ヤус罘純 Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} с罩e幻絎茵с障c≪絎茵筝罩≪障筝潟若с帥潟若с絎茵筝罩≪鴻純若鴻с純с") }.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $menu8x_demo $menu8x_demo = nil @@ -39,7 +39,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'menu8x'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') @@ -52,17 +52,17 @@ rescue windowingsystem = "" end -# label 生成 +# label TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { if $tk_platform['platform'] == 'macintosh' || windowingsystem == "classic" || windowingsystem == "aqua" - text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Command-X を入力すると、Xがコマンドキー記号に続いて表示されている文字ならば、アクセラレータを使った項目起動を行うことができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。") + text("c潟罕<ャ若鴻宴若<ャ若罕障Command-X ュX潟潟取垩膓茵腓冴絖違≪祉若帥篏帥c莎桁茵с障<ャ取膣筝緇<ャ若御х腴с障") else - text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Alt-X を入力すると、Xがメニューにアンダーライン付きで表示されている文字ならば、キーボードからの指定ができます。矢印キーでメニューのトラバースも可能です。メニューが指定された際には、スペースキーで実行することができます。あるいは、アンダーライン付きの文字を入力することでも実行できます。メニューのエントリがアクセラレータを持っている場合は、そのアクセラレータを入力することでメニューを指定することなしに実行することができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。") + text("c潟罕<ャ若鴻宴若<ャ若罕障Alt-X ュX<ャ若≪潟若ゃ割ц;腓冴絖違若若絎с障√違若с<ャ若若鴻純с<ャ若絎鴻若鴻若у茵с障≪潟若ゃ割絖ュс絎茵с障<ャ若潟≪祉若帥c翫≪祉若帥ュс<ャ若絎絎茵с障<ャ取膣筝緇<ャ若御х腴с障") end }.pack('side'=>'top') -# 状態表示の生成 +# 倶茵腓冴 $menu8xstatus = TkVariable.new(" ") TkFrame.new(base_frame) {|frame| TkLabel.new(frame, 'textvariable'=>$menu8xstatus, 'relief'=>'sunken', @@ -70,11 +70,11 @@ TkFrame.new(base_frame) {|frame| .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $menu8x_demo $menu8x_demo = nil @@ -83,24 +83,24 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'menu8x'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# menu 生成 +# menu TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|file_menu| m.add('cascade', 'label'=>'File', 'menu'=>file_menu, 'underline'=>0) - add('command', 'label'=>'開く ...', 'command'=>proc{fail 'これは、デモですので"開く ..."に対するアクションは定義されていません。'}) - add('command', 'label'=>'新規', 'command'=>proc{fail 'これは、デモですので"新規"に対するアクションは定義されていません。'}) - add('command', 'label'=>'保存', 'command'=>proc{fail 'これは、デモですので"保存"に対するアクションは定義されていません。'}) - add('command', 'label'=>'保存(指定) ...', 'command'=>proc{fail 'これは、デモですので"保存(指定) ..."に対するアクションは定義されていません。'}) + add('command', 'label'=>' ...', 'command'=>proc{fail '≪с" ..."絲障≪激с潟絎臂障'}) + add('command', 'label'=>'域', 'command'=>proc{fail '≪с"域"絲障≪激с潟絎臂障'}) + add('command', 'label'=>'篆絖', 'command'=>proc{fail '≪с"篆絖"絲障≪激с潟絎臂障'}) + add('command', 'label'=>'篆絖(絎) ...', 'command'=>proc{fail '≪с"篆絖(絎) ..."絲障≪激с潟絎臂障'}) add('separator') - add('command', 'label'=>'プリント設定 ...', 'command'=>proc{fail 'これは、デモですので"プリント設定 ..."に対するアクションは定義されていません。'}) - add('command', 'label'=>'プリント ...', 'command'=>proc{fail 'これは、デモですので"プリント ..."に対するアクションは定義されていません。'}) + add('command', 'label'=>'潟荐絎 ...', 'command'=>proc{fail '≪с"潟荐絎 ..."絲障≪激с潟絎臂障'}) + add('command', 'label'=>'潟 ...', 'command'=>proc{fail '≪с"潟 ..."絲障≪激с潟絎臂障'}) add('separator') - add('command', 'label'=>'終了', 'command'=>proc{$menu8x_demo.destroy}) + add('command', 'label'=>'腟篋', 'command'=>proc{$menu8x_demo.destroy}) } if $tk_platform['platform'] == 'macintosh' || @@ -114,10 +114,10 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|basic_menu| m.add('cascade', 'label'=>'Basic', 'menu'=>basic_menu, 'underline'=>0) - add('command', 'label'=>'何もしない長いエントリ') + add('command', 'label'=>'篏激潟') ['A','B','C','D','E','F','G'].each{|c| - # add('command', 'label'=>"文字 \"#{c}\" を印字", 'underline'=>4, - add('command', 'label'=>"Print letter \"#{c}\" (文字 \"#{c}\" を印字)", + # add('command', 'label'=>"絖 \"#{c}\" 医", 'underline'=>4, + add('command', 'label'=>"Print letter \"#{c}\" (絖 \"#{c}\" 医)", 'underline'=>14, 'accelerator'=>"Meta+#{c}", 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu8x_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) @@ -126,56 +126,56 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|cascade_menu| m.add('cascade', 'label'=>'Cascades', 'menu'=>cascade_menu, 'underline'=>0) - add('command', 'label'=>'Print hello(こんにちは)', - 'command'=>proc{print "Hello(こんにちは)\n"}, + add('command', 'label'=>'Print hello(<)', + 'command'=>proc{print "Hello(<)\n"}, 'accelerator'=>"#{modifier}+H", 'underline'=>6) - $menu8x_demo.bind("#{modifier}-h", proc{print "Hello(こんにちは)\n"}) - add('command', 'label'=>'Print goodbye(さようなら)', - 'command'=>proc{print "Goodbye(さようなら)\n"}, + $menu8x_demo.bind("#{modifier}-h", proc{print "Hello(<)\n"}) + add('command', 'label'=>'Print goodbye()', + 'command'=>proc{print "Goodbye()\n"}, 'accelerator'=>"#{modifier}+G", 'underline'=>6) - $menu8x_demo.bind("#{modifier}-g", proc{print "Goodbye(さようなら)\n"}) + $menu8x_demo.bind("#{modifier}-g", proc{print "Goodbye()\n"}) TkMenu.new(m, 'tearoff'=>false) {|cascade_check| - cascade_menu.add('cascade', 'label'=>'Check buttons(チェックボタン)', + cascade_menu.add('cascade', 'label'=>'Check buttons(с帥)', 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) - add('check', 'label'=>'オイル点検', 'variable'=>oil) + add('check', 'label'=>'ゃ号', 'variable'=>oil) trans = TkVariable.new(0) - add('check', 'label'=>'トランスミッション点検', 'variable'=>trans) + add('check', 'label'=>'潟鴻激с括号', 'variable'=>trans) brakes = TkVariable.new(0) - add('check', 'label'=>'ブレーキ点検', 'variable'=>brakes) + add('check', 'label'=>'若号', 'variable'=>brakes) lights = TkVariable.new(0) - add('check', 'label'=>'ライト点検', 'variable'=>lights) + add('check', 'label'=>'ゃ号', 'variable'=>lights) add('separator') - add('command', 'label'=>'現在の値を表示', + add('command', 'label'=>'憜ゃ茵腓', 'command'=>proc{showVars($menu8x_demo, - ['オイル点検', oil], - ['トランスミッション点検', trans], - ['ブレーキ点検', brakes], - ['ライト点検', lights])} ) + ['ゃ号', oil], + ['潟鴻激с括号', trans], + ['若号', brakes], + ['ゃ号', lights])} ) invoke 1 invoke 3 } TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| - cascade_menu.add('cascade', 'label'=>'Radio buttons(ラジオボタン)', + cascade_menu.add('cascade', 'label'=>'Radio buttons(吾帥)', 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new - add('radio', 'label'=>'10 ポイント', 'variable'=>pointSize, 'value'=>10) - add('radio', 'label'=>'14 ポイント', 'variable'=>pointSize, 'value'=>14) - add('radio', 'label'=>'18 ポイント', 'variable'=>pointSize, 'value'=>18) - add('radio', 'label'=>'24 ポイント', 'variable'=>pointSize, 'value'=>24) - add('radio', 'label'=>'32 ポイント', 'variable'=>pointSize, 'value'=>32) + add('radio', 'label'=>'10 ゃ潟', 'variable'=>pointSize, 'value'=>10) + add('radio', 'label'=>'14 ゃ潟', 'variable'=>pointSize, 'value'=>14) + add('radio', 'label'=>'18 ゃ潟', 'variable'=>pointSize, 'value'=>18) + add('radio', 'label'=>'24 ゃ潟', 'variable'=>pointSize, 'value'=>24) + add('radio', 'label'=>'32 ゃ潟', 'variable'=>pointSize, 'value'=>32) add('separator') style = TkVariable.new - add('radio', 'label'=>'ローマン', 'variable'=>style, 'value'=>'roman') - add('radio', 'label'=>'ボールド', 'variable'=>style, 'value'=>'bold') - add('radio', 'label'=>'イタリック', 'variable'=>style, 'value'=>'italic') + add('radio', 'label'=>'若', 'variable'=>style, 'value'=>'roman') + add('radio', 'label'=>'若', 'variable'=>style, 'value'=>'bold') + add('radio', 'label'=>'ゃ帥', 'variable'=>style, 'value'=>'italic') add('separator') - add('command', 'label'=>'現在の値を表示', + add('command', 'label'=>'憜ゃ茵腓', 'command'=>proc{showVars($menu8x_demo, - ['ポイントサイズ', pointSize], - ['スタイル', style])} ) + ['ゃ潟泣ゃ', pointSize], + ['鴻帥ゃ', style])} ) invoke 1 invoke 7 } @@ -188,9 +188,9 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| 'images','pattern.xbm'].join(File::Separator), 'hidemargin'=>1, 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。', + 'text'=>'篁御<ャ若鴻с茵腓冴障篁ュ鴻с篁<ャ守紊障', 'bitmap'=>'', 'default'=>0, - 'buttons'=>'了解')} ) + 'buttons'=>'篋茹')} ) ['info', 'questhead', 'error'].each{|icon| add('command', 'bitmap'=>icon, 'hidemargin'=>1, 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) @@ -201,8 +201,8 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|more_menu| m.add('cascade', 'label'=>'More', 'menu'=>more_menu, 'underline'=>0) - [ 'エントリ','別のエントリ','何もしない','ほとんど何もしない', - '人生を意義あるものに' ].each{|i| + [ '潟','ャ潟','篏','祉篏', + '篋榊靸' ].each{|i| add('command', 'label'=>i, 'command'=>proc{print "You invoked \"#{i}\"\n"}) } diff --git a/ext/tk/sample/demos-jp/menubu.rb b/ext/tk/sample/demos-jp/menubu.rb index 78418ce3ea..06f9eb875e 100644 --- a/ext/tk/sample/demos-jp/menubu.rb +++ b/ext/tk/sample/demos-jp/menubu.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- require "tkcanvas" def optionMenu(menubutton, varName, firstValue, *rest) @@ -38,16 +38,16 @@ base_frame = TkFrame.new($menubu_demo).pack(:fill=>:both, :expand=>true) # version check if $tk_version.to_f < 8.0 -# label 生成 +# label TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { - text("実行しようとしたスクリプトは Tk8.0 以上で利用できる機能を利用しているため、あなたの Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} では正常に実行できません。よってデモの実行を中止しました。ただし、下のコード参照ボタンを押すことで、実行が中止されたスクリプトのソースを参照することは可能です。") + text("絎茵鴻 Tk8.0 篁ヤус罘純 Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} с罩e幻絎茵с障c≪絎茵筝罩≪障筝潟若с帥潟若с絎茵筝罩≪鴻純若鴻с純с") }.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $menubu_demo $menubu_demo = nil @@ -56,7 +56,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'menubu'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') @@ -160,8 +160,8 @@ center = TkFrame.new(body) { TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc { tmppath = $menubu_demo $menubu_demo = nil @@ -170,7 +170,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc { showCode 'menubu' } }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x', 'pady'=>'2m') @@ -179,10 +179,10 @@ msg = TkLabel.new(center) { # font $font wraplength '4i' justify 'left' - text "これはメニューボタンのデモです。\"Below\"のボタンは\ -下にメニューを出し、\"Right\"のボタンは右にメニューを出して、\ -……となります。この文章の下には2つのオプションメニューがあります。\ -1つは普通のメニューで、もう1つは16色のパレットです。" + text "<ャ若帥潟≪с\"Below\"帥潟\ +筝<ャ若冴\"Right\"帥潟劻<ャ若冴\ +障腴筝2ゃ激с潟<ャ若障\ +1ゃ<ャ若с1ゃ16蚊с" } msg.pack('side'=>'top', 'padx'=>25, 'pady'=>25) diff --git a/ext/tk/sample/demos-jp/msgbox.rb b/ext/tk/sample/demos-jp/msgbox.rb index ed5d01252e..ec7b4f2bbc 100644 --- a/ext/tk/sample/demos-jp/msgbox.rb +++ b/ext/tk/sample/demos-jp/msgbox.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # message boxes widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($msgbox_demo) && $msgbox_demo $msgbox_demo.destroy $msgbox_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $msgbox_demo = TkToplevel.new {|w| title("Message Box Demonstration") iconname("messagebox") @@ -18,15 +18,15 @@ $msgbox_demo = TkToplevel.new {|w| base_frame = TkFrame.new($msgbox_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"まず表示するアイコンとメッセージボックスの種類を選んで下さい。その後に\"メッセージボックス\"ボタンを押すと、指定したメッセージボックスが表示されます。").pack('side'=>'top') + 'text'=>"障茵腓冴≪ゃ潟潟<祉若吾鴻腮蕁吾т緇\"<祉若吾\"帥潟若絎<祉若吾鴻茵腓冴障").pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $msgbox_demo $msgbox_demo = nil @@ -35,17 +35,17 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'msgbox'} }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'メッセージボックス' + text '<祉若吾' command proc{showMessageBox $msgbox_demo} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame $msgbox_leftframe = TkFrame.new(base_frame) $msgbox_rightframe = TkFrame.new(base_frame) $msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', @@ -53,7 +53,7 @@ $msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', $msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') -TkLabel.new($msgbox_leftframe, 'text'=>'アイコン').pack('side'=>'top') +TkLabel.new($msgbox_leftframe, 'text'=>'≪ゃ潟').pack('side'=>'top') TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ .pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') @@ -65,7 +65,7 @@ $msgboxIcon = TkVariable.new('info') 'anchor'=>'w', 'fill'=>'x') } -TkLabel.new($msgbox_rightframe, 'text'=>'種類').pack('side'=>'top') +TkLabel.new($msgbox_rightframe, 'text'=>'腮蕁').pack('side'=>'top') TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ .pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') @@ -81,9 +81,9 @@ $msgboxType = TkVariable.new('ok') def showMessageBox(w) button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, 'title'=>'Message', 'parent'=>w, - 'message'=>"これは\"#{$msgboxType.value}\"という種類のメッセージボックスで、\"#{$msgboxIcon.value}\"のアイコンが表示されています。") + 'message'=>"\"#{$msgboxType.value}\"腮蕁<祉若吾鴻с\"#{$msgboxIcon.value}\"≪ゃ潟潟茵腓冴障") Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, - 'message'=>"あなたは \"#{button}\" を押しましたね。") + 'message'=>" \"#{button}\" 若障") end diff --git a/ext/tk/sample/demos-jp/msgbox2.rb b/ext/tk/sample/demos-jp/msgbox2.rb index 8c80e08d70..ad6d936036 100644 --- a/ext/tk/sample/demos-jp/msgbox2.rb +++ b/ext/tk/sample/demos-jp/msgbox2.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # message boxes widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($msgbox2_demo) && $msgbox2_demo $msgbox2_demo.destroy $msgbox2_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $msgbox2_demo = TkToplevel.new {|w| title("Message Box Demonstration") iconname("messagebox") @@ -18,15 +18,15 @@ $msgbox2_demo = TkToplevel.new {|w| base_frame = TkFrame.new($msgbox2_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"まず表示するアイコンとメッセージボックスの種類を選んで下さい。その後に\"メッセージボックス\"ボタンを押すと、指定された形式で、メッセージと詳細テキストとを持ったメッセージボックスが表示されます。").pack('side'=>'top') + 'text'=>"障茵腓冴≪ゃ潟潟<祉若吾鴻腮蕁吾т緇\"<祉若吾\"帥潟若絎綵√с<祉若吾荅括完鴻c<祉若吾鴻茵腓冴障").pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $msgbox2_demo $msgbox2_demo = nil @@ -35,17 +35,17 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'msgbox2'} }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'メッセージボックス' + text '<祉若吾' command proc{showMessageBox2 $msgbox2_demo} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame $msgbox_leftframe = TkFrame.new(base_frame) $msgbox_rightframe = TkFrame.new(base_frame) $msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', @@ -53,7 +53,7 @@ $msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', $msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y', 'pady'=>'.5c', 'padx'=>'.5c') -TkLabel.new($msgbox_leftframe, 'text'=>'アイコン').pack('side'=>'top') +TkLabel.new($msgbox_leftframe, 'text'=>'≪ゃ潟').pack('side'=>'top') TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ .pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') @@ -65,7 +65,7 @@ $msgboxIcon = TkVariable.new('info') 'anchor'=>'w', 'fill'=>'x') } -TkLabel.new($msgbox_rightframe, 'text'=>'種類').pack('side'=>'top') +TkLabel.new($msgbox_rightframe, 'text'=>'腮蕁').pack('side'=>'top') TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\ .pack('side'=>'top', 'fill'=>'x', 'expand'=>'no') @@ -81,10 +81,10 @@ $msgboxType = TkVariable.new('ok') def showMessageBox2(w) button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value, 'title'=>'Message', 'parent'=>w, - 'message'=>"\"#{$msgboxType.value}\"タイプのメッセージボックス", - 'detail'=>"これは\"#{$msgboxType.value}\"という種類のメッセージボックスで、\"#{$msgboxIcon.value}\"のアイコンが表示されています。下のボタンのいずれかを選択してクリックしてください。") + 'message'=>"\"#{$msgboxType.value}\"帥ゃ<祉若吾", + 'detail'=>"\"#{$msgboxType.value}\"腮蕁<祉若吾鴻с\"#{$msgboxIcon.value}\"≪ゃ潟潟茵腓冴障筝帥潟御") Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w, - 'message'=>"あなたは \"#{button}\" を押しましたね。") + 'message'=>" \"#{button}\" 若障") end diff --git a/ext/tk/sample/demos-jp/paned1.rb b/ext/tk/sample/demos-jp/paned1.rb index 987a073086..53d2e7162b 100644 --- a/ext/tk/sample/demos-jp/paned1.rb +++ b/ext/tk/sample/demos-jp/paned1.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # paned1.rb # @@ -23,23 +23,23 @@ base_frame = TkFrame.new($paned1_demo).pack(:fill=>:both, :expand=>true) TkLabel.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) -下の色付けされた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。 -もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない -場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような -より新しいバージョンの Tk を組み合わせて試す -ようにしてください。 +筝俄篋ゃc潟篁筝ゃc潟蚊с綏帥潟т篏蚊泣ゃ阪眼篏筝с茵腓冴腆阪茵腓冴贋違障鴻篁篏菴初泣ゃ冴紊眼茵腓冴翫鴻筝紊帥潟篏帥c +篏帥c Ruby 潟 Tk ゃ panedwindow 絎茖 +翫≪障с翫 panedwindow 絎茖 +違若吾с潟 Tk 腟水荅 + EOL # The bottom buttons TkFrame.new(base_frame){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'', :width=>15, :command=>proc{ $paned1_demo.destroy $paned1_demo = nil }).pack(:side=>:left, :expand=>true) - TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'潟若', :width=>15, :command=>proc{ showCode 'paned1' }).pack(:side=>:left, :expand=>true) } diff --git a/ext/tk/sample/demos-jp/paned2.rb b/ext/tk/sample/demos-jp/paned2.rb index a1aee81690..65bd41c757 100644 --- a/ext/tk/sample/demos-jp/paned2.rb +++ b/ext/tk/sample/demos-jp/paned2.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # paned2.rb -- # @@ -23,30 +23,30 @@ base_frame = TkFrame.new($paned2_demo).pack(:fill=>:both, :expand=>true) TkLabel.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top) -下のスクロールバー付きのウィジェットが置かれた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。 -もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない -場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような -より新しいバージョンの Tk を組み合わせて試す -ようにしてください。 +筝鴻若寂c吾с臀篋ゃc潟篁筝ゃc潟蚊с綏帥潟т篏蚊泣ゃ阪眼篏筝с茵腓冴腆阪茵腓冴贋違障鴻篁篏菴初泣ゃ冴紊眼茵腓冴翫鴻筝紊帥潟篏帥c +篏帥c Ruby 潟 Tk ゃ panedwindow 絎茖 +翫≪障с翫 panedwindow 絎茖 +違若吾с潟 Tk 腟水荅 + EOL # The bottom buttons TkFrame.new(base_frame){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'', :width=>15, :command=>proc{ $paned2_demo.destroy $paned2_demo = nil }).pack(:side=>:left, :expand=>true) - TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'潟若', :width=>15, :command=>proc{ showCode 'paned2' }).pack(:side=>:left, :expand=>true) } paneList = TkVariable.new # define as normal variable (not array) paneList.value = [ # ruby's array --> tcl's list - 'Ruby/Tk のウィジェット一覧', + 'Ruby/Tk c吾с筝荀', 'TkButton', 'TkCanvas', 'TkCheckbutton', @@ -87,8 +87,8 @@ TkPanedwindow.new(base_frame, :orient=>:vertical){|f| paned2_xscr = TkScrollbar.new(paned2_bottom) paned2_yscr = TkScrollbar.new(paned2_bottom) paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) { - insert('1.0', 'ここに配置されているのは、' + - 'ごく普通のテキストウィジェットです。') + insert('1.0', '臀' + + '鴻c吾сс') xscrollbar(paned2_xscr) yscrollbar(paned2_yscr) } diff --git a/ext/tk/sample/demos-jp/pendulum.rb b/ext/tk/sample/demos-jp/pendulum.rb index 48839aa58a..60556fd70a 100644 --- a/ext/tk/sample/demos-jp/pendulum.rb +++ b/ext/tk/sample/demos-jp/pendulum.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # This demonstration illustrates how Tcl/Tk can be used to construct # simulations of physical systems. @@ -26,15 +26,15 @@ msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text 'このデモは、物理系のシミュレーションに関わるようなアニメーション実行するために Ruby/Tk をどのように用いることができるかを示しています。左側のキャンバスは単純な振り子である物理系自体のグラフィカル表現であるのに対し、右側のキャンバスは系の位相空間のグラフ(角速度と角度とをプロットしたもの)になっています。左側のキャンバス上でクリックおよびドラッグを行って振り子の重りの位置を変えてみてください。' + text '≪膤祉激ャ若激с潟≪≪<若激с喝茵 Ruby/Tk с腓冴障綏眼c潟鴻膣絖с膤肢篏違c茵憗с絲障勀眼c潟鴻膤祉篏悟咲違鐚茹綺茹綺鐚c障綏眼c潟剛с潟違茵c絖篏臀紊帥' } msg.pack('side'=>'top') # create frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $pendulum_demo $pendulum_demo = nil @@ -43,7 +43,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'pendulum'} }.pack('side'=>'left', 'expand'=>'yes') diff --git a/ext/tk/sample/demos-jp/plot.rb b/ext/tk/sample/demos-jp/plot.rb index a49ed00df8..4147b35399 100644 --- a/ext/tk/sample/demos-jp/plot.rb +++ b/ext/tk/sample/demos-jp/plot.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # 2-D plot widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($plot_demo) && $plot_demo $plot_demo.destroy $plot_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $plot_demo = TkToplevel.new {|w| title("Plot Demonstration") iconname("Plot") @@ -18,17 +18,17 @@ $plot_demo = TkToplevel.new {|w| base_frame = TkFrame.new($plot_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left', - 'text'=>"このウィンドウは簡単な2次元のプロットを含んだキャンバス widgetです。表示された点をマウスボタン1でドラッグしてデータをいじることができます。"){ + 'text'=>"c潟膂≦2罨≦c潟 widgetс茵腓冴鴻鴻帥1с違若帥с障"){ pack('side'=>'top') } -# frame 生成 +# frame $plot_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $plot_demo $plot_demo = nil @@ -37,28 +37,28 @@ $plot_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'plot'} }.pack('side'=>'left', 'expand'=>'yes') } $plot_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# font 設定 +# font 荐絎 if $tk_version =~ /^4.*/ plotFont = '-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*' else font = 'Helvetica 18' end -# canvas 設定 +# canvas 荐絎 $plot_canvas = TkCanvas.new(base_frame,'relief'=>'raised','width'=>450,'height'=>300) $plot_canvas.pack('side'=>'top', 'fill'=>'x') -# plot 生成 +# plot TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2) TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2) TkcText.new($plot_canvas, 225, 20, - 'text'=>"簡単なプロット", 'font'=>plotFont, 'fill'=>'brown') + 'text'=>"膂≦", 'font'=>plotFont, 'fill'=>'brown') (0..10).each {|i| x = 100 + (i * 30) diff --git a/ext/tk/sample/demos-jp/puzzle.rb b/ext/tk/sample/demos-jp/puzzle.rb index 16d7ce497c..dbcb423463 100644 --- a/ext/tk/sample/demos-jp/puzzle.rb +++ b/ext/tk/sample/demos-jp/puzzle.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # widet demo 'puzzle' (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($puzzle_demo) && $puzzle_demo $puzzle_demo.destroy $puzzle_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $puzzle_demo = TkToplevel.new {|w| title("15-Puzzle Demonstration") iconname("15-Puzzle") @@ -18,20 +18,20 @@ $puzzle_demo = TkToplevel.new {|w| base_frame = TkFrame.new($puzzle_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下の15-パズルはボタンを集めてできています。空いている所の隣のピースをクリックすると、そのピースがその空いている場所にスライドします。この操作を続け、ピースがその数の順に上から下、左から右に並ぶようにしてください。" + text "筝15-冴帥潟с障腥冴c若鴻若鴻腥冴贋鴻ゃ障篏膓若鴻違筝筝綏劻筝吟" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $puzzle_demo $puzzle_demo = nil @@ -40,16 +40,16 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'puzzle'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame # -# Special trick: scrollbar widget を生成してその trough color を用いることで -# 空白部分のための暗色を選択し,設定する +# Special trick: scrollbar widget trough color +# 腥榊初蚊御鐚荐絎 # begin if Tk.windowingsystem() == 'aqua' @@ -81,9 +81,9 @@ base = TkFrame.new(base_frame) { s.destroy base.pack('side'=>'top', 'padx'=>'1c', 'pady'=>'1c') -# proc のスコープを閉じるため,proc 生成メソッドを用意 -# こうしておかねば,ループ中で値が変化する num の影響を受けて -# puzzleSwitch の第 2 引数が変化してしまい,期待通りにはならない. +# proc 鴻潟若鐚proc <純 +# 逸若筝уゃ紊 num 綵演帥 +# puzzleSwitch 膃 2 綣違紊障鐚緇鐚 def def_puzzleswitch_proc(w, num) proc{puzzleSwitch w, num} end diff --git a/ext/tk/sample/demos-jp/radio.rb b/ext/tk/sample/demos-jp/radio.rb index 3355f25116..efb613593d 100644 --- a/ext/tk/sample/demos-jp/radio.rb +++ b/ext/tk/sample/demos-jp/radio.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # radiobutton widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($radio_demo) && $radio_demo $radio_demo.destroy $radio_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $radio_demo = TkToplevel.new {|w| title("Radiobutton Demonstration") iconname("radio") @@ -18,24 +18,24 @@ $radio_demo = TkToplevel.new {|w| base_frame = TkFrame.new($radio_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下には2つのラジオボタングループが表示されています。ボタンをクリックすると、そのボタンだけがそのグループの中で選択されます。各グループに対してそのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。" + text "筝2ゃ吾帥潟違若茵腓冴障帥潟帥潟違若筝ч御障違若絲障違若筝帥潟御腓冴紊違蚊綵障憜紊違ゃ荀紊医с帥潟" } msg.pack('side'=>'top') -# 変数生成 +# 紊亥 size = TkVariable.new color = TkVariable.new -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $radio_demo $radio_demo = nil @@ -45,35 +45,35 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'radio'} }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text '変数参照' + text '紊医' command proc{ showVars(base_frame, ['size', size], ['color', color]) } }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame f_left = TkFrame.new(base_frame) f_right = TkFrame.new(base_frame) f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') -# radiobutton 生成 +# radiobutton [10, 12, 18, 24].each {|sz| TkRadioButton.new(f_left) { - text "ポイントサイズ #{sz}" + text "ゃ潟泣ゃ #{sz}" variable size relief 'flat' value sz }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') } -['赤', '緑', '青', '黄', '橙', '紫'].each {|col| +['莎', '膩', '', '藥', '罘', '膣'].each {|col| TkRadioButton.new(f_right) { text col variable color diff --git a/ext/tk/sample/demos-jp/radio2.rb b/ext/tk/sample/demos-jp/radio2.rb index 91496beb6d..0633a8def1 100644 --- a/ext/tk/sample/demos-jp/radio2.rb +++ b/ext/tk/sample/demos-jp/radio2.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # radio2.rb # @@ -28,7 +28,7 @@ msg = TkLabel.new(base_frame) { font $font wraplength '5i' justify 'left' - text "下には3つのラジオボタングループが表示されています。ボタンをクリックすると、そのボタンだけがそのグループの中で選択されます。各グループに対してそのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。" + text "筝3ゃ吾帥潟違若茵腓冴障帥潟帥潟違若筝ч御障違若絲障違若筝帥潟御腓冴紊違蚊綵障憜紊違ゃ荀紊医с帥潟" } msg.pack('side'=>'top') @@ -40,8 +40,8 @@ align = TkVariable.new # frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $radio2_demo $radio2_demo = nil @@ -51,12 +51,12 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'radio2'} }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text '変数参照' + text '紊医' command proc{ showVars(base_frame, ['size', size], ['color', color], ['compound', align]) @@ -65,11 +65,11 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # frame -f_left = TkLabelFrame.new(base_frame, 'text'=>'文字サイズ', +f_left = TkLabelFrame.new(base_frame, 'text'=>'絖泣ゃ', 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new(base_frame, 'text'=>'色', +f_mid = TkLabelFrame.new(base_frame, 'text'=>'', 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new(base_frame, 'text'=>'ビットマップ配置', +f_right = TkLabelFrame.new(base_frame, 'text'=>'臀', 'pady'=>2, 'padx'=>2) f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') @@ -78,14 +78,14 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') # radiobutton [10, 12, 18, 24].each {|sz| TkRadioButton.new(f_left) { - text "ポイントサイズ #{sz}" + text "ゃ潟泣ゃ #{sz}" variable size relief 'flat' value sz }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x') } -['赤', '緑', '青', '黄', '橙', '紫'].each {|col| +['莎', '膩', '', '藥', '罘', '膣'].each {|col| TkRadioButton.new(f_mid) { text col variable color @@ -95,8 +95,8 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') } -# label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', -label = Tk::Label.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', +# label = TkLabel.new(f_right, 'text'=>'', 'bitmap'=>'questhead', +label = Tk::Label.new(f_right, 'text'=>'', 'bitmap'=>'questhead', 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) diff --git a/ext/tk/sample/demos-jp/radio3.rb b/ext/tk/sample/demos-jp/radio3.rb index 763c522448..3356b6945b 100644 --- a/ext/tk/sample/demos-jp/radio3.rb +++ b/ext/tk/sample/demos-jp/radio3.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # radio3.rb # @@ -28,7 +28,7 @@ msg = TkLabel.new(base_frame) { font $font wraplength '5i' justify 'left' - text '下には3つのラジオボタングループが表示されています。ボタンをクリックすると、そのグループに属するすべてのボタンの中でクリックしたボタンだけが選択された状態になります。各グループには、そのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。「トライステート」ボタンが押されたときには、ラジオボタンの表示がトライステートモードになります。いずれかのボタンを選択すれば、ボタンの状態は元のように個々のボタンのon/off状態を示すようになります。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。' + text '筝3ゃ吾帥潟違若茵腓冴障帥潟違若絮鴻帥潟筝с帥潟御倶障違若違若筝帥潟御腓冴紊違蚊綵障ゃ鴻若帥潟若吾帥潟茵腓冴ゃ鴻若≪若障帥潟御違帥潟倶帥潟on/off倶腓冴障憜紊違ゃ荀紊医с帥潟' } msg.grid(:row=>0, :column=>0, :columnspan=>3, :sticky=>'nsew') @@ -42,16 +42,16 @@ TkFrame.new(base_frame) {|frame| TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - TkButton.new(frame, :text=>'変数参照', + TkButton.new(frame, :text=>'紊医', :image=>$image['view'], :compound=>:left, :command=>proc{ showVars(base_frame, ['size', size], ['color', color], ['compound', align]) }), - TkButton.new(frame, :text=>'コード参照', + TkButton.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'radio3'}), - TkButton.new(frame, :text=>'閉じる', + TkButton.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $radio3_demo @@ -65,17 +65,17 @@ TkFrame.new(base_frame) {|frame| } # frame -f_left = TkLabelFrame.new(base_frame, 'text'=>'文字サイズ', +f_left = TkLabelFrame.new(base_frame, 'text'=>'絖泣ゃ', 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new(base_frame, 'text'=>'色', +f_mid = TkLabelFrame.new(base_frame, 'text'=>'', 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new(base_frame, 'text'=>'ビットマップ配置', +f_right = TkLabelFrame.new(base_frame, 'text'=>'臀', 'pady'=>2, 'padx'=>2) f_left .grid('column'=>0, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2) f_mid .grid('column'=>1, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2) f_right.grid('column'=>2, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c') -TkButton.new(base_frame, 'text'=>'トライステート', +TkButton.new(base_frame, 'text'=>'ゃ鴻若', 'command'=>proc{size.value = 'multi'; color.value = 'multi'}){ grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c') } @@ -83,7 +83,7 @@ TkButton.new(base_frame, 'text'=>' # radiobutton [10, 12, 14, 18, 24].each {|sz| TkRadioButton.new(f_left) { - text "ポイントサイズ #{sz}" + text "ゃ潟泣ゃ #{sz}" variable size relief 'flat' value sz @@ -103,8 +103,8 @@ TkButton.new(base_frame, 'text'=>' }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') } -# label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', -label = Tk::Label.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', +# label = TkLabel.new(f_right, 'text'=>'', 'bitmap'=>'questhead', +label = Tk::Label.new(f_right, 'text'=>'', 'bitmap'=>'questhead', 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) diff --git a/ext/tk/sample/demos-jp/rolodex-j b/ext/tk/sample/demos-jp/rolodex-j index ee8dd110bc..f6e3afdacd 100644 --- a/ext/tk/sample/demos-jp/rolodex-j +++ b/ext/tk/sample/demos-jp/rolodex-j @@ -1,15 +1,15 @@ #!/usr/bin/env ruby -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # rolodex -- -# このスクリプトは Tom LaStrange の rolodex の一部です。 +# 鴻 Tom LaStrange rolodex 筝с # # Copyright (C) 1998 by Takaaki Tateishi # Time-stamp: "04/04/09 00:32:12 nagai" # require "tk" -Tk.encoding = "euc-jp" +Tk.encoding = "utf-8" def show_help(topic,x=0,y=0) if( topic.is_a?(TkWindow) ) @@ -24,20 +24,20 @@ def show_help(topic,x=0,y=0) if( $helpTopics.include?(topic) ) msg = $helpTopics[topic] else - msg = "このトピックについてのヘルプはまだ使用できません" + msg = "ゃ障篏睡с障" end TkDialog.new("title"=>"Rolodex Help", - "message"=>"「#{topic}」\n\n#{msg}", + "message"=>"#{topic}\n\n#{msg}", "default_button"=>0, "buttons"=>["OK"]) end def fillCard clearAction - $root.frame.entry[1].insert(0, "立石 孝彰") - $root.frame.entry[2].insert(0, "923-1292 石川県") - $root.frame.entry[3].insert(0, "辰口町 旭台 1-1") - $root.frame.entry[4].insert(0, "北陸先端科学技術大学院大学") + $root.frame.entry[1].insert(0, "腴 絖綵") + $root.frame.entry[2].insert(0, "923-1292 喝") + $root.frame.entry[3].insert(0, "莨医g 1-1") + $root.frame.entry[4].insert(0, "後腴腱絖茵紊у√ぇ絖") $root.frame.entry[5].insert(0,"private") $root.frame.entry[6].insert(0,"***-***-****") $root.frame.entry[7].insert(0,"***-***-****") @@ -59,7 +59,7 @@ end def fileAction TkDialog.new("title"=>"File Selection", - "message"=>"これはファイル選択ダイアログのダミーです。\n", + "message"=>"<ゃ御ゃ≪違若с\n", "default_button"=>0, "buttons"=>["OK"]) STDERR.print "dummy file name\n" @@ -67,9 +67,9 @@ end def deleteAction result = TkDialog.new("title"=>"Confirm Action", - "message"=>"よろしいですか?", + "message"=>"с鐚", "default_button"=>0, - "buttons"=>["キャンセル"]) + "buttons"=>["c潟祉"]) if( result.value == 0 ) clearAction end @@ -79,7 +79,7 @@ end class RolodexFrame < TkFrame attr_reader :entry, :label - LABEL = ["","名前:","住所","","","電話(自宅):","電話(会社):","Fax:"] + LABEL = ["",":","篏","","","肢(絎):","肢(篌腓):","Fax:"] def initialize(parent=nil,keys=nil) super(parent,keys) @@ -109,10 +109,10 @@ class RolodexButtons < TkFrame def initialize(parent,keys=nil) super(parent,keys) - @clear = TkButton.new(self,"text" => "クリアー") - @add = TkButton.new(self, "text" => "追加") - @search = TkButton.new(self, "text" => "検索") - @delete = TkButton.new(self, "text" => "消去") + @clear = TkButton.new(self,"text" => "≪") + @add = TkButton.new(self, "text" => "菴遵") + @search = TkButton.new(self, "text" => "罎膣") + @delete = TkButton.new(self, "text" => "羔サ") for w in [@clear,@add,@search,@delete] w.pack("side"=>"left", "padx"=>2) end @@ -128,43 +128,43 @@ class RolodexMenuFrame < TkFrame "borderwidth"=>1) @file = TkMenubutton.new(self, - "text"=> "ファイル", + "text"=> "<ゃ", "underline"=>0) @file_menu = TkMenu.new(@file) @file_menu.add("command", - "label" => "読み込み ...", + "label" => "茯粋昭 ...", "command" => proc{fileAction}, "underline" => 0) @file_menu.add("command", - "label" => "終了", + "label" => "腟篋", "command" => proc{$root.destroy}, "underline" => 0) @file.menu(@file_menu) @file.pack("side"=>"left") @help = TkMenubutton.new(self, - "text"=> "ヘルプ", + "text"=> "", "underline"=>0) @help_menu = TkMenu.new(@help) @help_menu.add("command", - "label"=> "コンテキストについて", - "command"=>proc{show_help("コンテキスト")}, + "label"=> "潟潟鴻ゃ", + "command"=>proc{show_help("潟潟鴻")}, "underline"=>3) @help_menu.add("command", - "label"=> "ヘルプについて", - "command"=>proc{show_help("ヘルプ")}, + "label"=> "ゃ", + "command"=>proc{show_help("")}, "underline"=>3) @help_menu.add("command", - "label"=> "ウィンドウについて", - "command"=>proc{show_help("ウィンドウ")}, + "label"=> "c潟ゃ", + "command"=>proc{show_help("c潟")}, "underline"=>3) @help_menu.add("command", - "label"=> "キー操作について", - "command"=>proc{show_help("キー操作")}, + "label"=> "惹篏ゃ", + "command"=>proc{show_help("惹篏")}, "underline"=>3) @help_menu.add("command", - "label"=> "バージョン情報", - "command"=>proc{show_help("バージョン情報")}, + "label"=> "若吾с恰", + "command"=>proc{show_help("若吾с恰")}, "underline"=>3) @help.menu(@help_menu) @help.pack("side"=>"right") @@ -198,16 +198,16 @@ $root.buttons.add.configure("command"=>proc{addAction}) $root.buttons.clear.configure("command"=>proc{clearAction}) $root.buttons.search.configure("command"=>proc{addAction; fillCard}) -$root.buttons.clear.configure("text"=> "クリアー Ctrl+C") +$root.buttons.clear.configure("text"=> "≪ Ctrl+C") $root.bind("Control-c",proc{clearAction}) -$root.buttons.add.configure("text"=> "追加 Ctrl+A") +$root.buttons.add.configure("text"=> "菴遵 Ctrl+A") $root.bind("Control-a",proc{addAction}) -$root.buttons.search.configure("text"=> "検索 Ctrl+S") +$root.buttons.search.configure("text"=> "罎膣 Ctrl+S") $root.bind("Control-s",proc{addAction; fillCard}) -$root.buttons.delete.configure("text"=> "消去 Ctrl+D") +$root.buttons.delete.configure("text"=> "羔サ Ctrl+D") $root.bind("Control-d",proc{deleteAction}) $root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F") @@ -227,74 +227,74 @@ $root.bind("Any-Help", $helpTopics = {} $helpTopics[$root.menu.file] = <:both, :expand=>true) -# label 生成 +# label TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left', - 'text'=>"このキャンバスwidgetはルーラーの模型です。ルーラーの右にあるのはタブストップの井戸で、ここから引っ張ってくることによってタブストップを作ることができます。また、すでにあるタブストップを動かすこともできます。タブストップを上方または下方にかすれて表示されるまでドラッグすると、マウスボタンを離した時にそのタブストップは消えます。"){ + 'text'=>"c潟widget若若罔≦с若若劻帥鴻篋吾с綣e宍cc帥鴻篏с障障с帥鴻с障帥鴻筝鴻障筝鴻茵腓冴障с違鴻帥潟≪帥鴻羔障"){ pack('side'=>'top') } -# frame 生成 +# frame $ruler_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $ruler_demo $ruler_demo = nil @@ -50,17 +50,17 @@ $ruler_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'ruler'} }.pack('side'=>'left', 'expand'=>'yes') } $ruler_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# canvas 設定 +# canvas 荐絎 $ruler_canvas = TkCanvas.new(base_frame, 'width'=>'14.8c', 'height'=>'2.5c') $ruler_canvas.pack('side'=>'top', 'fill'=>'x') -# 値設定 +# よ┃絎 unless Struct.const_defined?("RulerInfo") $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y, :top, :bottom, :size, :normalStyle, diff --git a/ext/tk/sample/demos-jp/sayings.rb b/ext/tk/sample/demos-jp/sayings.rb index b3bdbe0bc5..cf4fe7b1b1 100644 --- a/ext/tk/sample/demos-jp/sayings.rb +++ b/ext/tk/sample/demos-jp/sayings.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # listbox widget demo 'sayings' (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($sayings_demo) && $sayings_demo $sayings_demo.destroy $sayings_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $sayings_demo = TkToplevel.new {|w| title("Listbox Demonstration (well-known sayings)") iconname("sayings") @@ -18,20 +18,20 @@ $sayings_demo = TkToplevel.new {|w| base_frame = TkFrame.new($sayings_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下のリストボックスにはいろいろな格言が入っています。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。" + text "筝鴻鴻取ャc障鴻鴻若鴻若若сс障鴻鴻筝с鴻帥2(筝帥)若障障違с障" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $sayings_demo $sayings_demo = nil @@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'sayings'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame sayings_lbox = nil TkFrame.new(base_frame, 'borderwidth'=>10) {|w| sv = TkScrollbar.new(w) diff --git a/ext/tk/sample/demos-jp/search.rb b/ext/tk/sample/demos-jp/search.rb index 293ae83910..238450ae30 100644 --- a/ext/tk/sample/demos-jp/search.rb +++ b/ext/tk/sample/demos-jp/search.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # Text Search widget demo (called by 'widget') # @@ -62,13 +62,13 @@ def textToggle(cmd1,sleep1,cmd2,sleep2) -1, cmd1, cmd2).start(sleep1) end -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($search_demo) && $search_demo $search_demo.destroy $search_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $search_demo = TkToplevel.new {|w| title("Text Demonstration - Search and Highlight") iconname("search") @@ -77,11 +77,11 @@ $search_demo = TkToplevel.new {|w| base_frame = TkFrame.new($search_demo).pack(:fill=>:both, :expand=>true) -# frame 生成 +# frame $search_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $search_demo $search_demo = nil @@ -90,15 +90,15 @@ $search_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'search'} }.pack('side'=>'left', 'expand'=>'yes') } $search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame TkFrame.new(base_frame) {|f| - TkLabel.new(f, 'text'=>'ファイル名:', + TkLabel.new(f, 'text'=>'<ゃ:', 'width'=>13, 'anchor'=>'w').pack('side'=>'left') $search_fileName = TkVariable.new TkEntry.new(f, 'width'=>40, @@ -108,14 +108,14 @@ TkFrame.new(base_frame) {|f| $search_string_entry.focus}) focus } - TkButton.new(f, 'text'=>'読み込み', + TkButton.new(f, 'text'=>'茯粋昭', 'command'=>proc{textLoadFile($search_text, $search_fileName.value)})\ .pack('side'=>'left', 'pady'=>5, 'padx'=>10) }.pack('side'=>'top', 'fill'=>'x') TkFrame.new(base_frame) {|f| - TkLabel.new(f, 'text'=>'検索文字列:', + TkLabel.new(f, 'text'=>'罎膣∽絖:', 'width'=>13, 'anchor'=>'w').pack('side'=>'left') $search_searchString = TkVariable.new $search_string_entry = TkEntry.new(f, 'width'=>40, @@ -124,7 +124,7 @@ TkFrame.new(base_frame) {|f| bind('Return', proc{textSearch($search_text, $search_searchString.value, $search_Tag)}) } - TkButton.new(f, 'text'=>'反転', + TkButton.new(f, 'text'=>'荵', 'command'=>proc{textSearch($search_text, $search_searchString.value, $search_Tag)}) { @@ -165,15 +165,15 @@ else 200 ) end $search_text.insert('1.0', "\ -このウィンドウは検索機構を実現するのにテキスト widget のタグ機能がどの \ -ように使われるのかをデモするものです。まず上のエントリにファイル名を入 \ -れ、<リターン> を押すか「ロード」ボタンを押してください。次にその下の \ -エントリに文字列を入力し、<リターン> を押すか「反転」ボタンを押してく \ -ださい。するとファイル中の、検索文字列と一致する部分に全て \"search_Tag\" \ -というタグがつけられ、タグの表示属性としてその文字列が点滅するように \ -設定されます。\n") +c潟罎膣∽罕絎憗鴻 widget 帥井純 \ +篏帥≪с障筝潟<ゃ \ +<帥若> 若若帥潟若罨<筝 \ +潟絖ュ<帥若> 若荵≪帥潟若 \ +<ゃ筝罎膣∽絖筝眼 \"search_Tag\" \ +帥違ゃ帥違茵腓阪с絖号 \ +荐絎障\n") $search_text.insert('end', "\ -ファイル読み込みのカレントディレクトリは \"#{Dir.pwd}\" です。\ +<ゃ茯粋昭帥潟c \"#{Dir.pwd}\" с\ ") $search_text.set_insert '0.0' diff --git a/ext/tk/sample/demos-jp/spin.rb b/ext/tk/sample/demos-jp/spin.rb index 2bcc3217e6..fd51a3f457 100644 --- a/ext/tk/sample/demos-jp/spin.rb +++ b/ext/tk/sample/demos-jp/spin.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # spin.rb -- # @@ -22,35 +22,35 @@ base_frame = TkFrame.new($spin_demo).pack(:fill=>:both, :expand=>true) TkLabel.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left, :text=><:top) -下には3種類のスピンボックスが表示されています。 -それぞれ、マウスで選択して文字を入力することができます。 -編集操作としては、Emacs 形式の多くに加えて、一般的な -Motif 形式のキー操作がサポートされています。たとえば、 -Backspace と Control-h とは入力カーソルの左側の文字を -削除し、Delete と Control-d とは右側の文字を削除します。 -入力枠の長さを越えるような長い文字列を入力した場合には、 -マウスのボタン2を押してドラッグすることで、入力文字列 -をスキャンすることが可能です。 -なお、最初のスピンボックスは、整数値とみなされるような -文字列しか入力が許されないことに注意してください。また、 -3番目のスピンボックスで選択候補に現れるのはオーストラ -リアの都市名のリストとなっています。 -もしあなたが使っている Ruby にリンクされている Tk ライ -ブラリが spinbox ウィジェットを実装していない場合、この -デモはうまく動かないはずです。その場合には spinbox ウィ -ジェットが実装されているようなより新しいバージョンの Tk -を組み合わせて試すようにしてください。 +筝鐚腮蕁鴻潟鴻茵腓冴障 +鴻ч御絖ュс障 +膩篏Emacs 綵√紊筝 +Motif 綵√惹篏泣若障違 +Backspace Control-h ュ若純綏眼絖 +ゃDelete Control-d 勀眼絖ゃ障 +ュ激莇激絖ュ翫 +鴻帥鰹若違сュ絖 +鴻c潟純с +鴻潟鴻贋医ゃ帥 +絖ュ荐宴羈障 +鐚鴻潟鴻ч御茖憗若鴻 +≪遵鴻c障 +篏帥c Ruby 潟 Tk + spinbox c吾с絎茖翫 +≪障с翫 spinbox +吾с絎茖違若吾с潟 Tk +腟水荅 EOL TkFrame.new(base_frame){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'', :width=>15, :command=>proc{ $spin_demo.destroy $spin_demo = nil }).pack(:side=>:left, :expand=>true) - TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'潟若', :width=>15, :command=>proc{ showCode 'spin' }).pack(:side=>:left, :expand=>true) } diff --git a/ext/tk/sample/demos-jp/states.rb b/ext/tk/sample/demos-jp/states.rb index f354d28d84..2966e6d834 100644 --- a/ext/tk/sample/demos-jp/states.rb +++ b/ext/tk/sample/demos-jp/states.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # listbox widget demo 'states' (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($states_demo) && $states_demo $states_demo.destroy $states_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $states_demo = TkToplevel.new {|w| title("Listbox Demonstration (states)") iconname("states") @@ -18,20 +18,20 @@ $states_demo = TkToplevel.new {|w| base_frame = TkFrame.new($states_demo).pack(:fill=>:both, :expand=>true) -# label 生成 +# label msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' - text "下にあるのは都道府県名が入ったスクロールバー付のリストボックスです。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。" + text "筝初綺ャc鴻若寂鴻鴻с鴻鴻若鴻若若сс障鴻鴻筝с鴻帥2(筝帥)若障障違с障" } msg.pack('side'=>'top') -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $states_demo $states_demo = nil @@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'states'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame states_lbox = nil TkFrame.new(base_frame, 'borderwidth'=>'.5c') {|w| s = TkScrollbar.new(w) @@ -61,13 +61,13 @@ TkFrame.new(base_frame, 'borderwidth'=>'.5c') {|w| }.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y') ins_data = [ - '愛知','青森','秋田','石川','茨城','岩手','愛媛', - '大分','大阪','岡山','沖縄','香川','鹿児島','神奈川', - '岐阜','京都','熊本','群馬','高知','埼玉','佐賀', - '滋賀','静岡','島根','千葉','東京','徳島','栃木', - '鳥取','富山','長崎','長野','奈良','新潟','兵庫', - '広島','福井','福岡','福島','北海道','三重','宮城', - '宮崎','山形','山口','山梨','和歌山' + '','罍','腱','喝','','絏','紵', + '紊у','紊ч','絏≦臼','羃膰','薤綏','藕水絣','腑絅綏', + '絏','篋','','臂らΜ','蕭','主','篏莖', + '羯莖','絏','絣倶','','延根','緇喝涯','', + '薐ュ','絲絮','桁','潔','絅','井','球昆', + '綺絣','胼鋋','胼鎣','胼鎤','羌潔','筝','絎', + '絎經','絮怨就','絮怨','絮掩※','罩絮' ] states_lbox.insert(0, *ins_data) diff --git a/ext/tk/sample/demos-jp/style.rb b/ext/tk/sample/demos-jp/style.rb index 3189e1f6d8..813fde7a78 100644 --- a/ext/tk/sample/demos-jp/style.rb +++ b/ext/tk/sample/demos-jp/style.rb @@ -1,16 +1,16 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # text (display styles) widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($style_demo) && $style_demo $style_demo.destroy $style_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $style_demo = TkToplevel.new {|w| title("Text Demonstration - Display Styles") iconname("style") @@ -19,11 +19,11 @@ $style_demo = TkToplevel.new {|w| base_frame = TkFrame.new($style_demo).pack(:fill=>:both, :expand=>true) -# frame 生成 +# frame TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $style_demo $style_demo = nil @@ -32,15 +32,15 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'style'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# text 生成 +# text txt = TkText.new(base_frame){|t| - # 生成 + # setgrid 'true' #width 70 #height 32 @@ -53,7 +53,7 @@ txt = TkText.new(base_frame){|t| } pack('expand'=>'yes', 'fill'=>'both') - # テキストタグ設定 (フォント関連) + # 鴻帥域┃絎 (潟∫) family = 'Courier' if $tk_version =~ /^4.*/ @@ -89,7 +89,7 @@ txt = TkText.new(base_frame){|t| # style_tag_small = TkTextTag.new(t, 'font'=>'@cSmallFont') # end - # テキストタグ設定 (色,レリーフ関連) + # 鴻帥域┃絎 (駕若∫) if TkWinfo.depth($root).to_i > 1 style_tag_color1 = TkTextTag.new(t, 'background'=>'#a0b7ce') style_tag_color2 = TkTextTag.new(t, 'foreground'=>'red') @@ -106,7 +106,7 @@ txt = TkText.new(base_frame){|t| 'relief'=>'sunken', 'borderwidth'=>1) end - # テキストタグ設定 (その他) + # 鴻帥域┃絎 (篁) if $tk_version =~ /^4\.[01]/ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black', 'borderwidth'=>0, @@ -134,134 +134,134 @@ txt = TkText.new(base_frame){|t| 'lmargin1'=>'12m', 'lmargin2'=>'6m', 'rmargin'=>'10m') - # テキスト挿入 - insert('end', 'このようにテキスト widget は情報を様々なスタイルで表示すること -ができます。') - insert('end', 'タグ', style_tag_big) - insert('end', 'というメカニズムでコントロールされます。 -タグとはテキスト widget 内のある文字 (の範囲)に対して適用できる -単なる名前のことです。タグは様々な表示スタイルに設定できます。 -設定すると、そのタグのついた文字は指定したスタイルで表示される -ようになります。使用できる表示スタイルは次の通りです。 + # 鴻水 + insert('end', '鴻 widget 宴罕鴻帥ゃц;腓冴 +с障') + insert('end', '帥', style_tag_big) + insert('end', '<冴с潟潟若障 +帥違鴻 widget 絖 (膀)絲障с +с帥違罕茵腓冴鴻帥ゃ荐絎с障 +荐絎帥違ゃ絖絎鴻帥ゃц;腓冴 +障篏睡с茵腓冴鴻帥ゃ罨<с ') insert('end', ' -1. フォント', style_tag_big) - insert('end', ' どんな X のフォントでも使えます。') +1. 潟', style_tag_big) + insert('end', ' X 潟с篏帥障') insert('end', 'large', style_tag_verybig) insert('end', ' -とか') -# insert('end', '小さい', style_tag_small) +') +# insert('end', '絨', style_tag_small) insert('end', 'small', style_tag_small) - insert('end', 'とか。 + insert('end', ' ') insert('end', ' -2. 色', style_tag_big) +2. ', style_tag_big) insert('end', ' ') - insert('end', '背景色', style_tag_color1) - insert('end', 'も') - insert('end', '前景色', style_tag_color2) - insert('end', 'も') - insert('end', '両方', style_tag_color1, style_tag_color2) - insert('end', 'とも変えることができます。 + insert('end', '', style_tag_color1) + insert('end', '') + insert('end', '', style_tag_color2) + insert('end', '') + insert('end', '筝≧', style_tag_color1, style_tag_color2) + insert('end', '紊с障 ') insert('end', ' -3. 網かけ', style_tag_big) - insert('end', ' このように描画の際に') - insert('end', '背景も', style_tag_bgstipple) - insert('end', '文字も', style_tag_fgstipple) - insert('end', '単なる塗りつぶし -でなく、網かけを使うことができます。 +3. 膓蚊', style_tag_big) + insert('end', ' 祉') + insert('end', '', style_tag_bgstipple) + insert('end', '絖', style_tag_fgstipple) + insert('end', '紂ゃ吟 +с膓蚊篏帥с障 ') insert('end', ' -4. 下線', style_tag_big) - insert('end', ' このように') - insert('end', '文字に下線を引く', style_tag_underline) - insert('end', 'ことができます。 +4. 筝膩', style_tag_big) + insert('end', ' ') + insert('end', '絖筝膩綣', style_tag_underline) + insert('end', 'с障 ') insert('end', ' -5. 打ち消し線', style_tag_big) - insert('end', ' このように') - insert('end', '文字に重ねて線を引く', style_tag_overstrike) - insert('end', 'ことができます。 +5. ≧膩', style_tag_big) + insert('end', ' ') + insert('end', '絖膩綣', style_tag_overstrike) + insert('end', 'с障 ') insert('end', ' -6. 3D 効果', style_tag_big) - insert('end', ' 背景に枠をつけて、文字を') - insert('end', '飛び出す', style_tag_raised) - insert('end', 'ようにしたり') - insert('end', '沈む', style_tag_sunken) +6. 3D 号', style_tag_big) + insert('end', ' ゃ絖') + insert('end', '蕋喝冴', style_tag_raised) + insert('end', '') + insert('end', '羃', style_tag_sunken) insert('end', ' -ようにできます。 +с障 ') insert('end', ' -7. 行揃え', style_tag_big) - insert('end', ' このように行を +7. 茵', style_tag_big) + insert('end', ' 茵 ') - insert('end', '左に揃えたり + insert('end', '綏 ') - insert('end', '右に揃えたり + insert('end', '劻 ', style_tag_right) - insert('end', '真中に揃えたりできます。 + insert('end', '筝с障 ', style_tag_center) insert('end', ' -8. 肩付き文字と添字', style_tag_big) +8. 篁絖羞糸', style_tag_big) insert('end', ' 10') insert('end', 'n', style_tag_super) - insert('end', ' のように肩付き文字の効果や、') + insert('end', ' 篁絖号') insert('end', ' X') insert('end', 'i', style_tag_sub) - insert('end', 'のように添字の効果を出すことができます。 + insert('end', '羞糸号冴с障 ') insert('end', ' -9. マージン', style_tag_big) - insert('end', 'テキストの左側に余分な空白を置くことができます: +9. 若吾', style_tag_big) + insert('end', '鴻綏眼篏腥榊純臀с障: ') - insert('end', 'この段落はマージンの使用例です。スクリーン', + insert('end', '罧笈純若吾潟篏睡箴с鴻若', style_tag_margins) - insert('end', '上で折り返されて表示されている1行のテキストです。', + insert('end', '筝ф菴茵腓冴1茵鴻с', style_tag_margins) - insert('end', '左側には2種類のマージンを持ちます。', style_tag_margins) - insert('end', '1行目に対するものと、', style_tag_margins) - insert('end', '2行目以降の連続したマージン', style_tag_margins) - insert('end', 'です。また右側にもマージンがあります。', style_tag_margins) - insert('end', '行の折り返し位置を決めるために使用することができます。 + insert('end', '綏眼2腮蕁若吾潟<障', style_tag_margins) + insert('end', '1茵絲障', style_tag_margins) + insert('end', '2茵篁ラg若吾', style_tag_margins) + insert('end', 'с障勀眼若吾潟障', style_tag_margins) + insert('end', '茵菴篏臀羆冴篏睡с障 ', style_tag_margins) insert('end', ' -10. スペーシング', style_tag_big) - insert('end', '3つのパラメータで行のスペーシングを') - insert('end', '制御す -ることができます。Spacing1で、行の') - insert('end', '上にどのくらいの空間を置くか、 +10. 鴻若激潟', style_tag_big) + insert('end', '3ゃ<若帥ц鴻若激潟違') + insert('end', '九勝 +с障Spacing1с茵') + insert('end', '筝腥咲臀 spacing3') - insert('end', 'で行の下にどのくらいの空間を置くか、') - insert('end', '行が折り返されているなら -ば、spacing2で、') - insert('end', 'テキスト行を生成している行の間にどのくらい') - insert('end', 'の空間を置 -くかを示します。 + insert('end', 'ц筝腥咲臀') + insert('end', '茵菴 +違spacing2с') + insert('end', '鴻茵茵') + insert('end', '腥咲臀 +腓冴障 ') - insert('end', 'これらのインデントされた段落はどのように', + insert('end', 'ゃ潟潟罧笈純', style_tag_spacing) - insert('end', 'スペーシングがが行われるのかを示します。', + insert('end', '鴻若激潟違茵腓冴障', style_tag_spacing) - insert('end', '各段落は実際はテキストwidget', style_tag_spacing) - insert('end', 'の1行で、widgetによって折り畳まれています。 + insert('end', '罧笈純絎鴻widget', style_tag_spacing) + insert('end', '1茵сwidgetc潟障障 ', style_tag_spacing) - insert('end', 'Spacing1はこのテキストでは10pointに', style_tag_spacing) - insert('end', '設定されています。', style_tag_spacing) - insert('end', 'これにより、段落の間に大きな間隔が', style_tag_spacing) - insert('end', '存在しています。', style_tag_spacing) - insert('end', 'Spacing2は2pointに設定されています。', style_tag_spacing) - insert('end', 'これで段落の中にほんの少し間隔が存在しています。', + insert('end', 'Spacing1鴻с10point', style_tag_spacing) + insert('end', '荐絎障', style_tag_spacing) + insert('end', '罧笈純紊с', style_tag_spacing) + insert('end', '絖障', style_tag_spacing) + insert('end', 'Spacing22point荐絎障', style_tag_spacing) + insert('end', 'ф笈純筝祉絨絖障', style_tag_spacing) - insert('end', 'Spacing3はこの例では使用されていません。 + insert('end', 'Spacing3箴с篏睡障 ', style_tag_spacing) - insert('end', '間隔がどこにあるかを見たければ、これらの段落の', + insert('end', '荀違罧笈純', style_tag_spacing) - insert('end', 'なかでテキストを選択してください。選択の', style_tag_spacing) - insert('end', '反転した部分には余分にとられた間隔が', style_tag_spacing) - insert('end', '含まれています。 + insert('end', 'с鴻御御', style_tag_spacing) + insert('end', '荵≪篏', style_tag_spacing) + insert('end', '障障 ', style_tag_spacing) } diff --git a/ext/tk/sample/demos-jp/tcolor b/ext/tk/sample/demos-jp/tcolor index 1c83a4b10b..f2d5458db4 100644 --- a/ext/tk/sample/demos-jp/tcolor +++ b/ext/tk/sample/demos-jp/tcolor @@ -1,20 +1,20 @@ #!/usr/bin/env ruby -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # tcolor -- -# このスクリプトはRGB,HSB,CYM形式をサポートする -# 簡易カラーエディタです。 +# 鴻RGB,HSB,CYM綵√泣若 +# 膂≧若c帥с # # Copyright (C) 1998 Takaaki Tateishi(ttate@jaist.ac.jp) # last update: Thu Jun 18 06:32:35 JST 1998 # -# まずはtk.rbを読み込む。 +# 障tk.rb茯粋昭 require "tk" -# Tkによって変更される変数はTkVariableのインスタンスを使う。 +# Tkc紊眼紊違TkVariableゃ潟鴻帥潟鴻篏帥 $colorSpace = TkVariable.new(:rgb) $master = nil @@ -32,13 +32,13 @@ $label2 = TkVariable.new("label2") $label3 = TkVariable.new("label3") -# リソースデータベースの設定 +# 純若鴻若帥若鴻荐絎 if (TkVarAccess.new('tcl_platform')['platform'] == 'unix') TkOptionDB.add('*Entry.background', 'white') end -# 各イベント用のメソッド +# ゃ潟<純 def rgbToHsv(red,green,blue) @@ -277,7 +277,7 @@ end -# tcolor用のメニュー +# tcolor<ャ class TkColorMenuFrame"raised", "borderwidth"=>"2") - # Fileメニューボタンの生成 + # File<ャ若帥潟 @file = TkMenubutton.new(self){|button| - # Fileメニューの作成 + # File<ャ若篏 @file_menu = TkMenu.new(button){ add "radio", "label" => "RGB color space", @@ -326,7 +326,7 @@ class TkColorMenuFrame proc{exit} } - # FileメニューとFileボタンを関連付ける + # File<ャ若File帥潟∫d menu @file_menu text "File" @@ -338,7 +338,7 @@ class TkColorMenuFrame'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'text'} }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# text 生成 +# text TkText.new(base_frame){|t| - # 生成 + # relief 'sunken' bd 2 setgrid 1 @@ -57,62 +57,62 @@ TkText.new(base_frame){|t| } pack('expand'=>'yes', 'fill'=>'both') - # テキスト挿入 + # 鴻水 insert('0.0', <"text#{count[0] += 1}") -first.insert :end,"このデモは一つの組を成したテキストウィジェットを示します。" -first.insert :end,"それらのテキストウィジェットは対等(ピア;peer)の関係に" -first.insert :end,"なっています。" -first.insert :end,"それらは、基盤となるデータモデルは共通のものを持ちますが、" -first.insert :end,"画面表示位置、編集位置、選択範囲(selection)については" -first.insert :end,"独立に持つことができます。" -first.insert :end,"各テキストウィジェットの脇にある" -first.insert :end,"「ピア(peer)の作成」ボタンを使えば、" -first.insert :end,"新たなピアを追加することが可能です。" -first.insert :end,"また「ピア(peer)の消去」ボタンを使えば、" -first.insert :end,"特定のピアウィジェットを消去することもできます。" +first.insert :end,"≪筝ゃ腟鴻c吾с腓冴障" +first.insert :end,"鴻c吾с絲丞(;peer)≫" +first.insert :end,"c障" +first.insert :end,"榊ゃ若帥≪演<障" +first.insert :end,"脂∵;腓坂臀膩篏臀御膀(selection)ゃ" +first.insert :end,"腴ゃс障" +first.insert :end,"鴻c吾с" +first.insert :end,"(peer)篏帥潟篏帥違" +first.insert :end,"違≪菴遵純с" +first.insert :end,"障(peer)羔サ帥潟篏帥違" +first.insert :end,"劫≪c吾с羔サс障" Tk.update_idletasks ## for 'first' widget @@ -44,10 +44,10 @@ def makeClone(count, win, txt) sbar = TkScrollbar.new(win, :widgetname=>"sb#{cnt}") peer.yscrollbar sbar b1 = TkButton.new(win, :widgetname=>"clone#{cnt}", - :text=>'ピア(peer)の作成', + :text=>'(peer)篏', :command=>proc{makeClone(count, win, peer)}) b2 = TkButton.new(win, :widgetname=>"kill#{cnt}", - :text=>'ピア(peer)の消去', + :text=>'(peer)羔サ', :command=>proc{killClone(win, cnt)}) row = cnt * 2 TkGrid.configure(peer, sbar, b1, :sticky=>'nsew', :row=>row) @@ -68,12 +68,12 @@ first.destroy ## See Code / Dismiss buttons TkFrame.new(base_frame){|f| - TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'', :width=>15, :command=>proc{ $textpeer_demo.destroy $textpeer_demo = nil }).pack(:side=>:left, :expand=>true) - TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'潟若', :width=>15, :command=>proc{ showCode 'textpeer' }).pack(:side=>:left, :expand=>true) diff --git a/ext/tk/sample/demos-jp/toolbar.rb b/ext/tk/sample/demos-jp/toolbar.rb index 570d52704f..3ee7a5f9d8 100644 --- a/ext/tk/sample/demos-jp/toolbar.rb +++ b/ext/tk/sample/demos-jp/toolbar.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # toolbar.rb -- # @@ -21,32 +21,32 @@ base_frame = Ttk::Frame.new($toolbar_demo).pack(:fill=>:both, :expand=>true) if Tk.windowingsystem != 'aqua' msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><'4i', :text=><'toolbar') # ウィンドウタイトル文字列とするために,ウィジェット名を明示しています. +tbar_base = Tk::Frame.new(base_frame, # Tk 罔羣 frame с違障鐚 + :widgetname=>'toolbar') # c潟帥ゃ絖鐚c吾с腓冴障鐚 sep = Ttk::Separator.new(base_frame) to_base = Ttk::Frame.new(tbar_base, :cursor=>'fleur') if Tk.windowingsystem != 'aqua' @@ -72,7 +72,7 @@ if Tk.windowingsystem != 'aqua' self.grid_remove w.grid_remove self.wm_manage - # self.wm_title('Toolbar') # もしウィジェット名をウィンドウタイトルにしたくないなら,ここで設定してください + # self.wm_title('Toolbar') # c吾сc潟帥ゃ鐚ц┃絎 self.wm_protocol('WM_DELETE_WINDOW'){ self.untearoff(w) } end def tbar_base.untearoff(w) @@ -86,17 +86,17 @@ end text = TkText.new(base_frame, :width=>40, :height=>10) ## Toolbar contents -tb_btn = Ttk::Button.new(tbar_base, :text=>'ボタン', :style=>'Toolbutton', +tb_btn = Ttk::Button.new(tbar_base, :text=>'帥', :style=>'Toolbutton', :command=>proc{ - text.insert(:end, "ボタンが押されました.\n") + text.insert(:end, "帥潟若障鐚\n") }) -tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'チェックボタン', +tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'с帥', :style=>'Toolbutton', :variable=>(check = TkVariable.new), :command=>proc{ - text.insert(:end, "チェックボタンの値は#{check.value}です.\n") + text.insert(:end, "с帥潟ゃ#{check.value}с鐚\n") }) -tb_mbtn = Ttk::Menubutton.new(tbar_base, :text=>'メニュー') +tb_mbtn = Ttk::Menubutton.new(tbar_base, :text=>'<ャ') tb_combo = Ttk::Combobox.new(tbar_base, :value=>TkFont.families, :state=>:readonly) tb_mbtn.menu(menu = Tk::Menu.new(tb_mbtn)) @@ -121,10 +121,10 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'toolbar'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $toolbar_demo.destroy diff --git a/ext/tk/sample/demos-jp/tree.rb b/ext/tk/sample/demos-jp/tree.rb index 00d715282b..1c779391d4 100644 --- a/ext/tk/sample/demos-jp/tree.rb +++ b/ext/tk/sample/demos-jp/tree.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # tree.rb -- # @@ -24,14 +24,14 @@ base_frame = TkFrame.new($tree_demo).pack(:fill=>:both, :expand=>true) Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6], :text=><:x) -Ttkとは,テーマ指定可能な新しいウィジェット集合です.\ -このサンプルは,ファイルシステムのような階層的なデータ集合を\ -参照できるようにしたTtk::Treeviewウィジェットを含んでいます.\ -Ttk::Treeviewウィジェットは,木構造自体の表示を可能にするだけでなく,\ -追加情報(このサンプルの場合はファイルサイズ)を表示するために\ -任意の個数の追加カラムも扱うこともできます.\ -また,カラムのタイトル間の区切り部分をドラッグすることで,\ -カラムの幅を変更することも可能です. +Ttk鐚若絎純違c吾сс鐚\ +泣潟鐚<ゃ激鴻絮ょ若翠\ +ссTtk::Treeviewc吾сс障鐚\ +Ttk::Treeviewc吾с鐚罕篏茵腓冴純с鐚\ +菴遵(泣潟翫<ゃ泣ゃ)茵腓冴\ +篁紙違菴遵宴с障鐚\ +障鐚帥ゃ阪違э\ +綛紊眼純с鐚 EOL ## See Code / Dismiss @@ -39,10 +39,10 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'tree'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $tree_demo.destroy diff --git a/ext/tk/sample/demos-jp/ttkbut.rb b/ext/tk/sample/demos-jp/ttkbut.rb index 90ec3fce5b..ccde541019 100644 --- a/ext/tk/sample/demos-jp/ttkbut.rb +++ b/ext/tk/sample/demos-jp/ttkbut.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # ttkbut.rb # @@ -23,22 +23,22 @@ base_frame = TkFrame.new($ttkbut_demo).pack(:fill=>:both, :expand=>true) Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) -Ttkとは,テーマ指定可能な新しいウィジェット集合です.\ -今,あなたが目にしているのはTtkのテーマ化ラベルで,\ -下にはTtkのラベルフレームの中に三つのグループのTtkウィジェットが\ -表示されています. -最初のグループは全てボタンであり,\ -それぞれクリックすれば現在のアプリケーションのテーマが設定されます. -2番目のグループは三つのチェックボタン集合です.\ -各集合の間には,セパレータウィジェットが置かれています.\ -なお「有効化」ボタンは,このトップレベルウィジェット内の\ -他のすべてのテーマ化ウィジェットの状態(state)が"disabled"かどうかを\ -コントロールすることに注意してください. -3番目のグループは関連付けられたラジオボタン集合となっています. +Ttk鐚若絎純違c吾сс鐚\ +篁鐚Ttk若э\ +筝Ttk若筝筝ゃ違若Ttkc吾с\ +茵腓冴障鐚 +違若帥潟с鐚\ +亥憜≪宴若激с潟若荐絎障鐚 +鐚違若筝ゃс帥渇с鐚\ +鐚祉若帥c吾с臀障鐚\ +劫帥潟鐚c吾с\ +篁鴻若c吾с倶(state)"disabled"\ +潟潟若羈鐚 +鐚違若∫d吾帥渇c障鐚 EOL ## Add buttons for setting the theme -buttons = Ttk::Labelframe.new(base_frame, :text=>'ボタン') +buttons = Ttk::Labelframe.new(base_frame, :text=>'帥') # Ttk::Style.theme_names.each{|theme| # Ttk::Button.new(buttons, :text=>theme, # :command=>proc{Ttk::Style.theme_use theme}).pack(:pady=>2) @@ -66,9 +66,9 @@ def setState(root, value, *excepts) end ## Set up the checkbutton group -checks = Ttk::Labelframe.new(base_frame, :text=>'チェックボタン') +checks = Ttk::Labelframe.new(base_frame, :text=>'с帥') enabled = TkVariable.new(true) -e = Ttk::Checkbutton.new(checks, :text=>'有効化', :variable=>enabled, +e = Ttk::Checkbutton.new(checks, :text=>'劫', :variable=>enabled, :command=>proc{ setState($ttkbut_demo, ((enabled.bool)? "!disabled" : "disabled"), @@ -84,15 +84,15 @@ tomato = TkVariable.new basil = TkVariable.new oregano = TkVariable.new -c1 = Ttk::Checkbutton.new(checks, :text=>'チーズ', :variable=>cheese) -c2 = Ttk::Checkbutton.new(checks, :text=>'トマト', :variable=>tomato) -c3 = Ttk::Checkbutton.new(checks, :text=>'バジル', :variable=>basil) -c4 = Ttk::Checkbutton.new(checks, :text=>'オレガノ', :variable=>oregano) +c1 = Ttk::Checkbutton.new(checks, :text=>'若', :variable=>cheese) +c2 = Ttk::Checkbutton.new(checks, :text=>'', :variable=>tomato) +c3 = Ttk::Checkbutton.new(checks, :text=>'吾', :variable=>basil) +c4 = Ttk::Checkbutton.new(checks, :text=>'', :variable=>oregano) Tk.pack(e, sep1, c1, c2, sep2, c3, c4, :fill=>:x, :pady=>2) ## Set up the radiobutton group -radios = Ttk::Labelframe.new(base_frame, :text=>'ラジオボタン') +radios = Ttk::Labelframe.new(base_frame, :text=>'吾帥') happyness = TkVariable.new @@ -114,18 +114,18 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'変数参照', + Ttk::Button.new(frame, :text=>'紊医', :image=>$image['view'], :compound=>:left, :command=>proc{ - showVars(base_frame, ['有効化', enabled], - ['チーズ', cheese], ['トマト', tomato], - ['バジル', basil], ['オレガノ', oregano], - ['幸福度', happyness]) + showVars(base_frame, ['劫', enabled], + ['若', cheese], ['', tomato], + ['吾', basil], ['', oregano], + ['綛悟鎺', happyness]) }), - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'ttkbut'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $ttkbut_demo diff --git a/ext/tk/sample/demos-jp/ttkmenu.rb b/ext/tk/sample/demos-jp/ttkmenu.rb index 9e78678c8e..aa9db5019f 100644 --- a/ext/tk/sample/demos-jp/ttkmenu.rb +++ b/ext/tk/sample/demos-jp/ttkmenu.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # ttkmenu.rb -- # @@ -22,21 +22,21 @@ base_frame = Ttk::Frame.new($ttkmenu_demo).pack(:fill=>:both, :expand=>true) Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) -Ttkとは,テーマ指定可能な新しいウィジェット集合です.\ -これによりテーマに対応することができるようになったウィジェットのひとつに\ -メニューボタンがあります.\ -以下では,テーマに対応したメニューボタンがいくつか表示されています.\ -それらを使って,現在使用中のテーマを変更することが可能です.\ -テーマの選択がメニューボタン自身の見掛けを変化させる様子や,\ -中央のメニューボタンだけが異なるスタイル\ -(ツールバーでの一般的な表示に適したもの)で表示されている様子に\ -注目してください.\ -なお,メニューボタンについてはテーマに対応したウィジェットがありますが,\ -メニューについてはテーマに対応したウィジェットは含まれていません.\ -その理由は,標準のTkのメニューウィジェットが\ -すべてのプラットホームで十分に良好な見掛けと操作性を持っている,\ -特に,多くの環境でその環境本来の操作体系となるように実装されていると\ -判断されたことによります. +Ttk鐚若絎純違c吾сс鐚\ +若絲上сcc吾с蚊ゃ\ +<ャ若帥潟障鐚\ +篁ヤс鐚若絲上<ャ若帥潟ゃ茵腓冴障鐚\ +篏帥c鐚憜篏睡筝若紊眼純с鐚\ +若御<ャ若帥活荳荀紊罕絖鐚\ +筝紊<ャ若帥潟違鴻帥ゃ\ +(若若с筝茵腓冴)ц;腓冴罕絖\ +羈鐚\ +鐚<ャ若帥潟ゃ若絲上c吾с障鐚\ +<ャ若ゃ若絲上c吾с障障鐚\ +宴鐚罔羣Tk<ャ若c吾с\ +鴻若у絅純荀篏сc鐚\ +鴻鐚紊医с医ャ篏篏膤祉絎茖\ +ゆ障鐚 EOL Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x) @@ -46,10 +46,10 @@ Ttk::Frame.new($ttkmenu_demo) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'ttkmenu'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkmenu_demo.destroy @@ -60,12 +60,12 @@ Ttk::Frame.new($ttkmenu_demo) {|frame| pack(:side=>:bottom, :fill=>:x) } -b1 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:above) -b2 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:left) -b3 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:right) -b4 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:flush, +b1 = Ttk::Menubutton.new(base_frame,:text=>'若御',:direction=>:above) +b2 = Ttk::Menubutton.new(base_frame,:text=>'若御',:direction=>:left) +b3 = Ttk::Menubutton.new(base_frame,:text=>'若御',:direction=>:right) +b4 = Ttk::Menubutton.new(base_frame,:text=>'若御',:direction=>:flush, :style=>Ttk::Menubutton.style('Toolbutton')) -b5 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:below) +b5 = Ttk::Menubutton.new(base_frame,:text=>'若御',:direction=>:below) b1.menu(m1 = Tk::Menu.new(b1, :tearoff=>false)) b2.menu(m2 = Tk::Menu.new(b2, :tearoff=>false)) diff --git a/ext/tk/sample/demos-jp/ttknote.rb b/ext/tk/sample/demos-jp/ttknote.rb index f0cd258893..f3b2fa5881 100644 --- a/ext/tk/sample/demos-jp/ttknote.rb +++ b/ext/tk/sample/demos-jp/ttknote.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # ttknote.rb -- # @@ -23,10 +23,10 @@ Ttk::Frame.new($ttknote_demo) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'ttknote'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttknote_demo.destroy @@ -48,31 +48,31 @@ notebook.enable_traversal f_msg = Ttk::Frame.new(notebook) msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'5i', :justify=>:left, :anchor=>'n', :text=><'すてきだ!(Neat!)', :underline=>6, +msg_b = Ttk::Button.new(f_msg, :text=>'鐚(Neat!)', :underline=>6, :command=>proc{ - neat.value = 'あぁ,そのとおりさ...' + neat.value = '鐚鐚鐚鐚' Tk.after_cancel(after_id) if after_id after_id = Tk.after(500){neat.value = ''} }) msg_b.winfo_toplevel.bind('Alt-n'){ msg_b.focus; msg_b.invoke } msg_l = Ttk::Label.new(f_msg, :textvariable=>neat) -notebook.add(f_msg, :text=>'説明(Description)', :underline=>3, :padding=>2) +notebook.add(f_msg, :text=>'茯(Description)', :underline=>3, :padding=>2) Tk.grid(msg_m, '-', :sticky=>'new', :pady=>2) Tk.grid(msg_b, msg_l, :pady=>[2, 4], :padx=>20) msg_b.grid_configure(:sticky=>'e') @@ -82,11 +82,11 @@ f_msg.grid_columnconfigure([0, 1], :weight=>1, :uniform=>1) ## Populate the second pane. Note that the content doesn't really matter f_disabled = Ttk::Frame.new(notebook) -notebook.add(f_disabled, :text=>'無効化されたタブ', :state=>:disabled) +notebook.add(f_disabled, :text=>'≦劫帥', :state=>:disabled) ## Popuplate the third pane f_editor = Ttk::Frame.new(notebook) -notebook.add(f_editor, :text=>'テキストエディタ(Text Editor)', :underline=>9) +notebook.add(f_editor, :text=>'鴻c(Text Editor)', :underline=>9) editor_t = Tk::Text.new(f_editor, :width=>40, :height=>10, :wrap=>:char) if Tk.windowingsystem != 'aqua' editor_s = editor_t.yscrollbar(Ttk::Scrollbar.new(f_editor)) diff --git a/ext/tk/sample/demos-jp/ttkpane.rb b/ext/tk/sample/demos-jp/ttkpane.rb index a7b458a683..a5c1a08ec9 100644 --- a/ext/tk/sample/demos-jp/ttkpane.rb +++ b/ext/tk/sample/demos-jp/ttkpane.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # ttkpane.rb -- # @@ -21,9 +21,9 @@ base_frame = TkFrame.new($ttkpane_demo).pack(:fill=>:both, :expand=>true) Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) -このデモは,埋め込み関係にあるテーマ付きペインドウィンドウを示しています.\ -それぞれの大きさは,含まれているペインの間にあるエリアをつかんで\ -境界をドラッグすることで変更できます. +≪鐚莨若翠≫若篁ゃ潟c潟腓冴障鐚\ +紊с鐚障ゃ潟≪ゃ\ +紜違у眼с障鐚 EOL Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x) @@ -33,10 +33,10 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'ttkpane'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkpane_demo.destroy @@ -52,19 +52,19 @@ frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true) outer = Ttk::Panedwindow.new(frame, :orient=>:horizontal) outer.add(in_left = Ttk::Panedwindow.new(outer, :orient=>:vertical)) outer.add(in_right = Ttk::Panedwindow.new(outer, :orient=>:vertical)) -in_left.add(left_top = Ttk::Labelframe.new(in_left, :text=>'ボタン')) -in_left.add(left_bot = Ttk::Labelframe.new(in_left, :text=>'時計')) -in_right.add(right_top = Ttk::Labelframe.new(in_right, :text=>'プログレス')) -in_right.add(right_bot = Ttk::Labelframe.new(in_right, :text=>'テキスト')) +in_left.add(left_top = Ttk::Labelframe.new(in_left, :text=>'帥')) +in_left.add(left_bot = Ttk::Labelframe.new(in_left, :text=>'荐')) +in_right.add(right_top = Ttk::Labelframe.new(in_right, :text=>'違')) +in_right.add(right_bot = Ttk::Labelframe.new(in_right, :text=>'鴻')) if Tk.windowingsystem == 'aqua' [left_top, left_bot, right_top, right_bot].each{|w| w.padding(3) } end # Fill the button pane -Ttk::Button.new(left_top, :text=>'押してね', +Ttk::Button.new(left_top, :text=>'若', :command=>proc{ Tk.messageBox(:type=>'ok', :icon=>'info', - :message=>'いてて!', + :message=>'鐚', :detail=>'That hurt...', :parent=>base_frame, :title=>'Button Pressed') }).pack(:padx=>2, :pady=>5) diff --git a/ext/tk/sample/demos-jp/ttkprogress.rb b/ext/tk/sample/demos-jp/ttkprogress.rb index 82898bf50e..ec28253a9f 100644 --- a/ext/tk/sample/demos-jp/ttkprogress.rb +++ b/ext/tk/sample/demos-jp/ttkprogress.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # ttkprogress.rb -- # @@ -21,16 +21,16 @@ base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true) Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left, :text=><:top, :fill=>:x) -下にあるのは二つのプログレスバーです.\ -上のものは"determinate"タイプのプログレスバーで,\ -例えばプログラムが与えられたタスクを終了するまでにどのくらいかかるかを\ -示すときなどに用いられます.\ -下のものは"indeterminate"タイプのプログレスバーで,\ -例えばプログラムが実行中(busy)であるものの\ -終了までにどれくらいかかるかは分からないという状態を\ -示すときなどに用いられます.\ -いずれのプログレスバーも,すぐ下にあるボタンを使うことで\ -自動アニメーションモードのON/OFFを切替えることができます. +筝篋ゃ違鴻若с鐚\ +筝"determinate"帥ゃ違鴻若э\ +箴違違筝帥鴻腟篋障с\ +腓冴障鐚\ +筝"indeterminate"帥ゃ違鴻若э\ +箴違違絎茵筝(busy)с\ +腟篋障с倶\ +腓冴障鐚\ +違鴻若鐚筝帥潟篏帥\ +≪<若激с潟≪若ON/OFF帥с障鐚 EOL ## See Code / Dismiss buttons @@ -38,10 +38,10 @@ Ttk::Frame.new(base_frame) {|frame| sep = Ttk::Separator.new(frame) Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - Ttk::Button.new(frame, :text=>'コード参照', + Ttk::Button.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'ttkprogress'}), - Ttk::Button.new(frame, :text=>'閉じる', + Ttk::Button.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ $ttkprogress_demo.destroy diff --git a/ext/tk/sample/demos-jp/twind.rb b/ext/tk/sample/demos-jp/twind.rb index bd0b060754..f13a137cc3 100644 --- a/ext/tk/sample/demos-jp/twind.rb +++ b/ext/tk/sample/demos-jp/twind.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # text (embedded windows) widget demo (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($twind_demo) && $twind_demo $twind_demo.destroy $twind_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $twind_demo = TkToplevel.new {|w| title("Text Demonstration - Embedded Windows") iconname("Embedded Windows") @@ -18,11 +18,11 @@ $twind_demo = TkToplevel.new {|w| base_frame = TkFrame.new($twind_demo).pack(:fill=>:both, :expand=>true) -# frame 生成 +# frame $twind_buttons = TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc{ tmppath = $twind_demo $twind_demo = nil @@ -31,13 +31,13 @@ $twind_buttons = TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc{showCode 'twind'} }.pack('side'=>'left', 'expand'=>'yes') } $twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame $twind_text = nil TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, 'relief'=>'sunken') {|f| @@ -51,7 +51,7 @@ TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, }.pack('expand'=>'yes', 'fill'=>'both') }.pack('expand'=>'yes', 'fill'=>'both') -# タグ生成 +# 帥亥 $tag_center = TkTextTag.new($twind_text, 'justify' =>'center', 'spacing1'=>'5m', @@ -64,70 +64,70 @@ $tag_buttons = TkTextTag.new($twind_text, 'spacing2'=>0, 'spacing3'=>0 ) -# テキストの生成 +# 鴻 $twind_text.insert('end', - 'テキストwidget上に他のwidgetを組み込むことができます。') + '鴻widget筝篁widget腟粋昭с障') $twind_text.insert('end', - '組み込みウィンドウと呼ばれ、任意のwidgetが可能です。') + '腟粋昭帥c潟若違篁紙widget純с') $twind_text.insert('end', - '例えば、ここに2つのボタンwidgetが組み込まれています。') -$twind_text.insert('end', '最初のボタンをクリックすと水平方向のスクロールを') + '箴違2ゃ帥widget腟粋昭障障') +$twind_text.insert('end', '帥潟羂翫抗劫鴻若') TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { #text 'ON' - text 'オン' + text '' command proc{textWindOn $twind_text,$twind_buttons} cursor 'top_left_arrow' }) -$twind_text.insert('end', "にします。また2つめのボタンをクリックすると\n") -$twind_text.insert('end', '水平方向のスクロールを') +$twind_text.insert('end', "障障2ゃ帥潟\n") +$twind_text.insert('end', '羂翫抗劫鴻若') TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { #text 'OFF' - text 'オフ' + text '' command proc{textWindOff $twind_text} cursor 'top_left_arrow' }) -$twind_text.insert('end', 'にします。') +$twind_text.insert('end', '障') -$twind_text.insert('end', 'もうひとつの例です。') +$twind_text.insert('end', '蚊ゃ箴с') TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { - text 'ここをクリック' + text '' command proc{textWindPlot $twind_text} cursor 'top_left_arrow' }) -$twind_text.insert('end', 'すると、x-yプロットがここに現れます。') +$twind_text.insert('end', 'x-y憗障') $mark_plot = TkTextMark.new($twind_text, 'insert') $mark_plot.gravity='left' -$twind_text.insert('end', 'マウスでデータを描画することができます。') +$twind_text.insert('end', '鴻с若帥祉с障') TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) { - text '消去' + text '羔サ' command proc{textWindDel $twind_text} cursor 'top_left_arrow' }) -$twind_text.insert('end', 'をクリックすると元に戻ります。 +$twind_text.insert('end', '祉障 ') -$twind_text.insert('end', '組み込みウィンドウだけをテキストwidget上に、実際の') -$twind_text.insert('end', 'テキストはなしで組み込むことは便利です。') -$twind_text.insert('end', 'この場合は、テキストwidgetはウィンドウマネージャの') -$twind_text.insert('end', 'ように動作します。例えば、ここにはテキストwidgetに') -$twind_text.insert('end', 'よってボタンがきれいに並べられています。') -$twind_text.insert('end', 'これらのボタンで背景色を変えることができます') -$twind_text.insert('end', '("Default"で元の色に戻すことができます)。') -$twind_text.insert('end', '"Short"というボタンをクリックすると文字列の長さが') -$twind_text.insert('end', '変わります。すると自動的にテキストwidgetが') -$twind_text.insert('end', 'レイアウトを整えてくれます。') -$twind_text.insert('end', 'もう一度同じボタンを押すと元に戻ります。 +$twind_text.insert('end', '腟粋昭帥c潟鴻widget筝絎') +$twind_text.insert('end', '鴻х粋昭箴水с') +$twind_text.insert('end', '翫鴻widgetc潟若吾c') +$twind_text.insert('end', '篏障箴違鴻widget') +$twind_text.insert('end', 'c帥潟筝鴻障') +$twind_text.insert('end', '帥潟ц蚊紊с障') +$twind_text.insert('end', '("Default"у蚊祉с障)') +$twind_text.insert('end', '"Short"帥潟絖激') +$twind_text.insert('end', '紊障鴻widget') +$twind_text.insert('end', 'ゃ≪眼障') +$twind_text.insert('end', '筝綺帥潟若祉障 ') TkTextWindow.new($twind_text, 'end', 'window'=>TkButton.new($twind_text) {|b| - text 'デフォルト' + text '' command proc{embDefBg $twind_text} cursor 'top_left_arrow' $tag_buttons.add('end') @@ -163,7 +163,7 @@ TkTextWindow.new($twind_text, 'end', 'pady'=>2 ) } -# メソッド定義 +# <純絎臂 def textWindOn (w,f) if defined? $twind_scroll begin diff --git a/ext/tk/sample/demos-jp/twind2.rb b/ext/tk/sample/demos-jp/twind2.rb index 96000b0e14..a783ba4738 100644 --- a/ext/tk/sample/demos-jp/twind2.rb +++ b/ext/tk/sample/demos-jp/twind2.rb @@ -1,15 +1,15 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # text (embedded windows) widget demo 2 (called by 'widget') # -# toplevel widget が存在すれば削除する +# toplevel widget 絖医ゃ if defined?($twind2_demo) && $twind2_demo $twind2_demo.destroy $twind2_demo = nil end -# demo 用の toplevel widget を生成 +# demo toplevel widget $twind2_demo = TkToplevel.new {|w| title("Text Demonstration - Embedded Windows 2") iconname("Embedded Windows") @@ -18,15 +18,15 @@ $twind2_demo = TkToplevel.new {|w| base_frame = TkFrame.new($twind2_demo).pack(:fill=>:both, :expand=>true) -# frame 生成 +# frame $twind2_buttons = TkFrame.new(base_frame) {|frame| TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2), :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2) TkGrid('x', - TkButton.new(frame, :text=>'コード参照', + TkButton.new(frame, :text=>'潟若', :image=>$image['view'], :compound=>:left, :command=>proc{showCode 'twind2'}), - TkButton.new(frame, :text=>'閉じる', + TkButton.new(frame, :text=>'', :image=>$image['delete'], :compound=>:left, :command=>proc{ tmppath = $twind2_demo @@ -39,7 +39,7 @@ $twind2_buttons = TkFrame.new(base_frame) {|frame| } $twind2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') -# frame 生成 +# frame $twind2_text = nil TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, 'relief'=>'sunken') {|f| @@ -54,7 +54,7 @@ TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2, }.pack('expand'=>'yes', 'fill'=>'both') }.pack('expand'=>'yes', 'fill'=>'both') -# タグ生成 +# 帥亥 $tag2_center = TkTextTag.new($twind2_text, 'justify' =>'center', 'spacing1'=>'5m', @@ -67,82 +67,82 @@ $tag2_buttons = TkTextTag.new($twind2_text, 'spacing2'=>0, 'spacing3'=>0 ) -# テキストの生成 -$twind2_text.insert('end', 'テキストウィジェットには色々な種類のアイテム') -$twind2_text.insert('end', '(動的なものや静的なものの両方があります)を') -$twind2_text.insert('end', '数多く含めることができます。そうしたアイテムは') -$twind2_text.insert('end', '行替え、タブ、中央揃えなどの様々な方法で') -$twind2_text.insert('end', '配置することができます。') -$twind2_text.insert('end', '加えて、テキストウィジェットの内容物が') -$twind2_text.insert('end', 'ウィンドウサイズに比べて大きすぎる場合でも') -$twind2_text.insert('end', 'すべての方向にスムーズにスクロールさせて') -$twind2_text.insert('end', '確認することが可能です。') +# 鴻 +$twind2_text.insert('end', '鴻c吾с蚊腮蕁≪ゃ') +$twind2_text.insert('end', '鐚筝≧鴻障鐚') +$twind2_text.insert('end', '医с障≪ゃ') +$twind2_text.insert('end', '茵帥帥筝紊罕号') +$twind2_text.insert('end', '臀с障') +$twind2_text.insert('end', '鴻c吾с絎合') +$twind2_text.insert('end', 'c潟泣ゃ冴罸鴻紊с翫с') +$twind2_text.insert('end', '鴻劫鴻若冴鴻若') +$twind2_text.insert('end', '腆肴純с') $twind2_text.insert('end', "\n\n") -$twind2_text.insert('end', 'テキストウィジェット上には他のウィジェットを') -$twind2_text.insert('end', '含めることもできます。こうしたものは') -$twind2_text.insert('end', '「埋め込みウィンドウ」と呼ばれ、その中に') -$twind2_text.insert('end', 'いかなるウィジェットでも詰め込むことができます。') -$twind2_text.insert('end', '例えば,ここには2つの') -$twind2_text.insert('end', 'ボタンウィジェットが埋め込まれています。') -$twind2_text.insert('end', '最初のボタンをクリックすると、') -$twind2_text.insert('end', '水平方向のスクロールを ') +$twind2_text.insert('end', '鴻c吾с筝篁c吾с') +$twind2_text.insert('end', 'с障') +$twind2_text.insert('end', '莨若帥c潟若違筝') +$twind2_text.insert('end', 'c吾сс荅違莨若с障') +$twind2_text.insert('end', '箴逸鐚ゃ') +$twind2_text.insert('end', '帥潟c吾с莨若障障') +$twind2_text.insert('end', '帥潟') +$twind2_text.insert('end', '羂翫抗劫鴻若 ') TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { #text 'ON' - text 'オン' + text '' command proc{textWindOn2 $twind2_text,$twind2_buttons} cursor 'top_left_arrow' }) -$twind2_text.insert('end', "にします。また、2つめのボタンをクリックすると\n") -$twind2_text.insert('end', '水平方向のスクロールを') +$twind2_text.insert('end', "障障鐚ゃ帥潟\n") +$twind2_text.insert('end', '羂翫抗劫鴻若') TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { #text 'OFF' - text 'オフ' + text '' command proc{textWindOff2 $twind2_text} cursor 'top_left_arrow' }) -$twind2_text.insert('end', "にします。\n\n") +$twind2_text.insert('end', "障\n\n") -$twind2_text.insert('end', '次はもうひとつの例です。') +$twind2_text.insert('end', '罨<蚊ゃ箴с') TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { - text 'ここをクリック' + text '' command proc{textWindPlot2 $twind2_text} cursor 'top_left_arrow' }) -$twind2_text.insert('end', 'すると、x-yプロットがここに現れます。') +$twind2_text.insert('end', 'x-y憗障') $mark2_plot = TkTextMark.new($twind2_text, 'insert') $mark2_plot.gravity='left' -$twind2_text.insert('end', 'マウスでドラッグすることで、') -$twind2_text.insert('end', 'プロット上のデータ点を移動することができます。') +$twind2_text.insert('end', '鴻с違с') +$twind2_text.insert('end', '筝若睡鴻腱糸с障') TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text) { - text '消去' + text '羔サ' command proc{textWindDel2 $twind2_text} cursor 'top_left_arrow' }) -$twind2_text.insert('end', 'をクリックすると元に戻ります。') +$twind2_text.insert('end', '祉障') $twind2_text.insert('end', "\n\n") -$twind2_text.insert('end', '表示するテキストなしに埋め込みウィンドウだけを') -$twind2_text.insert('end', 'テキストウィジェットに含めることも有用でしょう。') -$twind2_text.insert('end', 'この場合、テキストウィジェットは') -$twind2_text.insert('end', 'ジオメトリマネージャのように働きます。') -$twind2_text.insert('end', '例えば、ここにはテキストウィジェットに') -$twind2_text.insert('end', 'よってボタンがきれいに整列して配置されています。') -$twind2_text.insert('end', 'これらのボタンをクリックすることで、') -$twind2_text.insert('end', 'このテキストウィジェットの背景色を') -$twind2_text.insert('end', '変えることができます("デフォルト"ボタンで') -$twind2_text.insert('end', '元の色に戻すことができます)。') -$twind2_text.insert('end', '"Short"というボタンをクリックすると文字列の長さが') -$twind2_text.insert('end', '変わり、テキストウィジェットが自動的に') -$twind2_text.insert('end', 'レイアウトを整える様子を見ることができます。') -$twind2_text.insert('end', 'もう一度同じボタンを押すと元に戻ります。') +$twind2_text.insert('end', '茵腓冴鴻莨若帥c潟') +$twind2_text.insert('end', '鴻c吾сс') +$twind2_text.insert('end', '翫鴻c吾с') +$twind2_text.insert('end', '吾<若吾c障') +$twind2_text.insert('end', '箴違鴻c吾с') +$twind2_text.insert('end', 'c帥潟翫臀障') +$twind2_text.insert('end', '帥潟с') +$twind2_text.insert('end', '鴻c吾с蚊') +$twind2_text.insert('end', '紊с障(""帥潟') +$twind2_text.insert('end', '蚊祉с障)') +$twind2_text.insert('end', '"Short"帥潟絖激') +$twind2_text.insert('end', '紊鴻c吾с') +$twind2_text.insert('end', 'ゃ≪眼罕絖荀с障') +$twind2_text.insert('end', '筝綺帥潟若祉障') $twind2_text.insert('end', "\n") btn_default = TkButton.new($twind2_text) {|b| - text 'デフォルト' + text '' command proc{embDefBg2 $twind2_text} cursor 'top_left_arrow' } @@ -184,8 +184,8 @@ $text_normal2['border'] = $twind2_text.cget('borderwidth') $text_normal2['highlight'] = $twind2_text.cget('highlightthickness') $text_normal2['pad'] = $twind2_text.cget('padx') -$twind2_text.insert('end', "\nborder width や highlightthickness, ") -$twind2_text.insert('end', "padding を通常の値から変更することも可能です。\n") +$twind2_text.insert('end', "\nborder width highlightthickness, ") +$twind2_text.insert('end', "padding 絽吾ゃ紊眼純с\n") TkTextWindow.new($twind2_text, 'end', 'window'=>TkButton.new($twind2_text, :text=>"Big borders", @@ -229,8 +229,8 @@ TkTextWindow.new($twind2_text, 'end', textWinSmallP2 $twind2_text })) -$twind2_text.insert('end', "\n\n更にイメージもテキストウィジェットに") -$twind2_text.insert('end', "うまく配置できます:") +$twind2_text.insert('end', "\n\n眼ゃ<若吾鴻c吾с") +$twind2_text.insert('end', "障臀с障鐚") TkTextImage.new($twind2_text, 'end', 'image'=>TkBitmapImage.new(:file=>[ @@ -238,7 +238,7 @@ TkTextImage.new($twind2_text, 'end', 'images', 'face.xbm' ].join(File::Separator))) -# メソッド定義 +# <純絎臂 def textWinBigB2(w) w.borderwidth 15 end diff --git a/ext/tk/sample/demos-jp/unicodeout.rb b/ext/tk/sample/demos-jp/unicodeout.rb index 4857cd131d..31596cf8fd 100644 --- a/ext/tk/sample/demos-jp/unicodeout.rb +++ b/ext/tk/sample/demos-jp/unicodeout.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- # # unicodeout.rb -- # @@ -23,41 +23,41 @@ base_frame = TkFrame.new($unicodeout_demo).pack(:fill=>:both, :expand=>true) TkLabel.new(base_frame, :font=>$font, :wraplength=>'5.4i', :justify=>:left, :text=><:top) -これは,Tkにおける非欧米文字集合を用いる言語に対するサポートについての\ -サンプルです.ただし,下の表示においてあなたが実際にどのような表示を\ -目にするかは,あなたの環境にどのような文字集合がインストールされているかに\ -大きく依存します.また,対象となる文字集合がインストールされていない場合に\ -どのような表示がなされるかもあなたの環境次第です.\ -「コード参照」ボタンを押してソースを表示し,\ -Unicodeout_SampleFrameクラスの@@fontの定義を書き換えて\ -(ファイルの内容は変更されません)\ -「再実行」ボタンのクリックを試してみてください. -スクリプトが可搬性を持つように,文字列は\\uXXXXという\ -Tclのエスケープ表現を用いたUNICODE文字列で書かれています.\ -文字列は,Tk::UTF8_Stringメソッドによって,\ -「UTF8形式の文字列である」という\ -エンコード情報付きの文字列オブジェクト\ -(Tclのエスケープ表現の変換済み)に変換して\ -ラベルウィジェットに渡している点に注意してください. +鐚Tk罨х嘘絖荐茯絲障泣若ゃ\ +泣潟с鐚鐚筝茵腓冴絎茵腓冴\ +鐚医絖ゃ潟鴻若\ +紊с鋐絖障鐚障鐚絲乗院絖ゃ潟鴻若翫\ +茵腓冴医罨∞с鐚\ +潟若с帥潟若純若鴻茵腓冴鐚\ +Unicodeout_SampleFrame鴻@@font絎臂吾\ +(<ゃ絎鴻紊眼障)\ +絎茵帥潟荅帥鐚 +鴻сゃ鐚絖\\uXXXX\ +Tcl鴻宴若茵憗UNICODE絖ф吾障鐚\ +絖鐚Tk::UTF8_String<純c鐚\ +UTF8綵√絖с\ +潟潟若延絖吾с\ +(Tcl鴻宴若茵憗紊羝)紊\ +c吾с羝<鴻羈鐚 EOL #' TkFrame.new(base_frame){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') - TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'', :width=>15, :command=>proc{ $unicodeout_demo.destroy $unicodeout_demo = nil }).pack(:side=>:left, :expand=>true) - TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ + TkButton.new(f, :text=>'潟若', :width=>15, :command=>proc{ showCode 'unicodeout' }).pack(:side=>:left, :expand=>true) } wait_msg = TkLabel.new(base_frame, - :text=>"フォント読み込みの完了まで" + - "しばらくお待ち下さい...", + :text=>"潟茯粋昭帥絎篋障" + + "違緇>鐚鐚鐚", :font=>"Helvetica 12 italic").pack class Unicodeout_SampleFrame < TkFrame diff --git a/ext/tk/sample/demos-jp/vscale.rb b/ext/tk/sample/demos-jp/vscale.rb index a1097fd77f..6ae513bc33 100644 --- a/ext/tk/sample/demos-jp/vscale.rb +++ b/ext/tk/sample/demos-jp/vscale.rb @@ -1,4 +1,4 @@ -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- require "tkcanvas" if defined?($vscale_demo) && $vscale_demo @@ -18,17 +18,17 @@ msg = TkLabel.new(base_frame) { font $font wraplength '3.5i' justify 'left' -# text "下には矢印が1つと乗直なスケールが表示されています。\ -#スケール上でマウスボタン1をクリック、またはドラッグすると\ -#矢印の長さを変えることができます。" - text "にはバーと縦型のスケールが表示されています。スケールでマウスのボタン1 をクリックするかドラッグしてバーの高さを変えることができます。終ったら「了解」ボタンを押してください。" +# text "筝√違1ゃ箙眼鴻宴若茵腓冴障\ +#鴻宴若筝с鴻帥1障違\ +#√違激紊с障" + text "若膰鴻宴若茵腓冴障鴻宴若с鴻帥1 違若蕭紊с障腟c篋茹c帥潟若" } msg.pack('side'=>'top', 'padx'=>'.5c') TkFrame.new(base_frame) {|frame| TkButton.new(frame) { - #text '了解' - text '閉じる' + #text '篋茹' + text '' command proc { tmppath = $vscale_demo $vscale_demo = nil @@ -37,7 +37,7 @@ TkFrame.new(base_frame) {|frame| }.pack('side'=>'left', 'expand'=>'yes') TkButton.new(frame) { - text 'コード参照' + text '潟若' command proc { showCode 'vscale' } }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') diff --git a/ext/tk/sample/demos-jp/widget b/ext/tk/sample/demos-jp/widget index fc3c084e9a..193c15affd 100644 --- a/ext/tk/sample/demos-jp/widget +++ b/ext/tk/sample/demos-jp/widget @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -# -*- coding: euc-jp -*- +# -*- coding: utf-8 -*- -# 漢字コード設定 ( tk.rb のロード時の encoding 推定/設定に使われる ) +# 羲√潟若荐絎 ( tk.rb 若 encoding ィ絎/荐絎篏帥 ) #if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!!!! unless defined?(::Encoding.default_external) $KCODE = 'euc' @@ -9,28 +9,28 @@ else DEFAULT_TK_ENCODING = 'EUC-JP' end -# tk 関係ライブラリの読み込み +# tk ≫ゃ茯粋昭 require 'tk' # require 'tkafter' $RubyTk_WidgetDemo = true -# widget demo directory 位置の獲得 +# widget demo directory 篏臀峨 # $demo_dir = File.dirname($0) $demo_dir = File.dirname(__FILE__) -# root の生成 +# root $root = TkRoot.new{title "Ruby/Tk Widget Demonstration"} -# tk バージョンの取得 +# tk 若吾с潟緇 $tk_version = Tk::TK_VERSION $tk_major_ver, $tk_minor_ver = $tk_version.split('.').map{|n| n.to_i} $tk_patchlevel = Tk::TK_PATCHLEVEL -# tcl_platform 情報へのアクセスオブジェクト +# tcl_platform 宴吾≪祉鴻吾с $tk_platform = TkVarAccess.new('tcl_platform') -# フォント設定 +# 潟荐絎 ####### case($tk_version) when /^4.*/ @@ -64,7 +64,7 @@ else end ####### -# イメージ設定 +# ゃ<若梧┃絎 $image = {} if $tk_major_ver >= 8 @@ -123,7 +123,7 @@ $image['print'] = TkPhotoImage.new(:height=>19, :format=>'GIF', :data=><= 8 $root.add_menubar([[['File', 0], ['About ... ', proc{aboutBox}, 0, ''], @@ -154,7 +154,7 @@ TkFrame.new($root){|frame| }.pack('side'=>'top', 'fill'=>'x') =end -# テキストボックスの生成 +# 鴻鴻 if $tk_version =~ /^4\.[01]/ scr = TkScrollbar.new($root, 'orient'=>'vertical') txt = TkText.new($root) { @@ -215,7 +215,7 @@ else }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) end -# テキストタグ設定 +# 鴻帥域┃絎 if $tk_version =~ /^4.*/ tag_title = TkTextTag.new(txt, 'font'=>'-*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*') else @@ -277,267 +277,267 @@ tag_demo.bind('Motion', proc{|x, y| }, '%x %y') -# テキスト生成 +# 鴻 txt.insert('end', 'Ruby/Tk : Widget', tag_title) -#txt.insert('end', " デモンストレーション\n", tag_middle) -txt.insert('end', " デモンストレーション\n", tag_kanji_title) +#txt.insert('end', " ≪潟鴻若激с\n", tag_middle) +txt.insert('end', " ≪潟鴻若激с\n", tag_kanji_title) txt.insert('end', <<"EOT") -このアプリケーションは、Tk Widget を用いてどのようなことができるか\ -を示すための、いくつかの小さなスクリプトに対するフロントエンドを提\ -供しています。以下に順番に挙げられているデモンストレーションを実行\ -するにはマウスでクリックしてください。デモンストレーションのウィン\ -ドウが現れると、デモンストレーションを生成した Ruby/Tk のコードを見\ -るために、"コード参照"ボタンをクリックすることができます。あなたが\ -望むなら、そのコードを修正することができます。修正したコードでデモ\ -ンストレーションを再実行するためには、コードが書かれたウィンドウに\ -ある"デモ再実行" ボタンをクリックしてください。\ -コードを修正してもオリジナルのファイルが書き換えられることは\ -ありませんから、心配せずに色々な変更を試してみてください。 - -一部のデモでは、比較的最近のバージョンの Tk でなければサポートして\ -いない機能を使って実装しています(例えば Tk8.4 以上など)。そのため、\ -そうした機能を持たない Tk ライブラリを使っている場合には、そうした\ -デモは正しく動きません。そのような機能が必要であれば、それをサポート\ -している Tk ライブラリを使うように tcltklib をコンパイルしなおして\ -ください。 - -もしあなたの Tk が (最初から含むかインストールしたかにより) \ -Ttk (Tile) 拡張を利用できる状態であるなら、\ -Ttk 拡張のデモ (sample/tkextlib/tile/demo.rb) もぜひ試してみてください。 -( 多分,現在のあなたの環境には Ttk 拡張は\ +≪宴若激с潟Tk Widget с\ +腓冴ゃ絨鴻絲障潟潟\ +箴障篁ヤ≪潟鴻若激с潟絎茵\ +鴻с≪潟鴻若激с潟c\ +憗≪潟鴻若激с潟 Ruby/Tk 潟若荀\ +"潟若"帥潟с障\ +潟若篆罩cс障篆罩c潟若с\ +潟鴻若激с潟絎茵潟若吾c潟\ +"√絎茵" 帥潟\ +潟若篆罩c吾<ゃ吾\ +障綽蚊紊眼荅帥 + +筝≪с罸莠菴若吾с潟 Tk с違泣若\ +罘純篏帥c絎茖障(箴 Tk8.4 篁ヤ)\ +罘純 Tk ゃ篏帥c翫\ +≪罩c障罘純綽荀с違泣若\ + Tk ゃ篏帥 tcltklib 潟潟ゃ\ + + + Tk (ゃ潟鴻若) \ +Ttk (Tile) ≦宍с倶с\ +Ttk ≦宍 (sample/tkextlib/tile/demo.rb) 画帥 +( 紊鐚憜医 Ttk ≦宍\ #{ begin require 'tkextlib/tile' - "すでに導入されています" + "с絨ャ障" rescue - "まだインストールされていません" + "障ゃ潟鴻若障" end }\ -。) -Ttk 拡張は、Tk8.5 以上では標準の機能として組み込まれています。 +) +Ttk ≦宍Tk8.5 篁ヤс罔羣罘純腟粋昭障障 EOT -#txt.insert('end',"ラベル, ボタン, チェックボタン, ラジオボタン\n",tag_middle) -txt.insert('end', "ラベル, ボタン, チェックボタン, ラジオボタン\n", +#txt.insert('end',", 帥, с帥, 吾帥\n",tag_middle) +txt.insert('end', ", 帥, с帥, 吾帥\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. ラベル (テキスト, ビットマップ)\n", +txt.insert('end', "1. (鴻, )\n", tag_demo, "demo-label") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. ラベルとUNICODEテキスト (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-unicodeout") +txt.insert('end', "2. UNICODE鴻 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-unicodeout") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ボタン \n", tag_demo, "demo-button") +txt.insert('end', "3. 帥 \n", tag_demo, "demo-button") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. チェックボタン (複数を選択可能)\n", +txt.insert('end', "4. с帥 (茲違御)\n", tag_demo, "demo-check") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. 3状態チェックボタン (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "5. 鐚倶с帥 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-check2") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. ラジオボタン (任意の一つを選択可能)\n", +txt.insert('end', "6. 吾帥 (篁紙筝ゃ御)\n", tag_demo, "demo-radio") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "7. ラジオボタン (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "7. 吾帥 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-radio2") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "8. 3状態ラジオボタン (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "8. 鐚倶吾帥 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-radio3") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "9. ボタンで作られた15-パズルゲーム\n", +txt.insert('end', "9. 帥潟т15-冴蚊若\n", tag_demo, "demo-puzzle") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "10. ビットマップを使用したアイコンボタン\n", +txt.insert('end', "10. 篏睡≪ゃ潟潟帥\n", tag_demo, "demo-icon") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "11. 画像を表示する二つのラベル\n", +txt.insert('end', "11. 糸茵腓冴篋ゃ\n", tag_demo, "demo-image1") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "12. 画像を見るための簡単なユーザインターフェース\n", +txt.insert('end', "12. 糸荀膂≦若吟ゃ潟帥若с若\n", tag_demo, "demo-image2") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "13. 画像を見るための簡単なユーザインターフェース (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "13. 糸荀膂≦若吟ゃ潟帥若с若 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-image3") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "14. ラベル付きフレーム (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "14. 篁若 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-labelframe") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "15. テーマに対応したウィジェットの簡単な例 (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "15. 若絲上c吾с膂≦箴 (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo, "demo-ttkbut") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -#txt.insert('end', "リストボックス\n", tag_middle) -txt.insert('end', "リストボックス\n", tag_kanji_title) +#txt.insert('end', "鴻\n", tag_middle) +txt.insert('end', "鴻\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. 都道府県.\n", tag_demo, "demo-states") +txt.insert('end', "1. 初綺.\n", tag_demo, "demo-states") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. 色: アプリケーションのための配色を変える\n", +txt.insert('end', "2. : ≪宴若激с潟蚊紊\n", "#{tag_demo.id} demo-colors") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. 格言集\n", tag_demo, "demo-sayings") +txt.insert('end', "3. 取\n", tag_demo, "demo-sayings") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. 国についてのマルチカラムリスト (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "4. 純ゃ鴻 (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo, "demo-mclist") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. ディレクトリブラウザ (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "5. c (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo, "demo-tree") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -#txt.insert('end', "エントリとスピンボックス\n", tag_middle) -txt.insert('end', "エントリ\n", tag_kanji_title) +#txt.insert('end', "潟鴻潟\n", tag_middle) +txt.insert('end', "潟\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. スクロールバーなし\n", tag_demo, "demo-entry1") +txt.insert('end', "1. 鴻若若\n", tag_demo, "demo-entry1") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. スクロールバーあり\n", tag_demo, "demo-entry2") +txt.insert('end', "2. 鴻若若\n", tag_demo, "demo-entry2") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. 認証処理付きのエントリボックスとパスワードフィールド (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "3. 茯荐弱篁潟鴻鴻若c若 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-entry3") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. スピンボックス (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "4. 鴻潟 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-spin") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. コンボボックス (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "5. 潟潟 (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo, "demo-combo") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. 簡単なフォーム\n", tag_demo, "demo-form") +txt.insert('end', "6. 膂≦若\n", tag_demo, "demo-form") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -#txt.insert('end', "テキスト\n", tag_middle) -txt.insert('end', "テキスト\n", tag_kanji_title) +#txt.insert('end', "鴻\n", tag_middle) +txt.insert('end', "鴻\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. 基本的なテキスト\n", tag_demo, "demo-text") +txt.insert('end', "1. 堺鴻\n", tag_demo, "demo-text") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. 表示スタイル.\n", tag_demo, "demo-style") +txt.insert('end', "2. 茵腓冴鴻帥ゃ.\n", tag_demo, "demo-style") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ハイパーテキスト(タグバインド).\n", +txt.insert('end', "3. ゃ若鴻(帥違ゃ潟).\n", tag_demo, "demo-bind") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. ウィンドウを埋め込んだテキスト\n", +txt.insert('end', "4. c潟莨若鴻\n", tag_demo, "demo-twind") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. ウィンドウを埋め込んだテキスト (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "5. c潟莨若鴻 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-twind2") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. 検索\n", tag_demo, "demo-search") +txt.insert('end', "6. 罎膣\n", tag_demo, "demo-search") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "7. テキストウィジェットの対等化(peering) (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-textpeer") +txt.insert('end', "7. 鴻c吾с絲丞(peering) (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-textpeer") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -#txt.insert('end', "キャンバス\n", tag_middle) -txt.insert('end', "キャンバス\n", tag_kanji_title) +#txt.insert('end', "c潟\n", tag_middle) +txt.insert('end', "c潟\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. アイテムの型\n", tag_demo, "demo-items") +txt.insert('end', "1. ≪ゃ\n", tag_demo, "demo-items") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. 2 次元のプロット\n", tag_demo, "demo-plot") +txt.insert('end', "2. 2 罨≦\n", tag_demo, "demo-plot") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. テキスト\n", tag_demo, "demo-ctext") +txt.insert('end', "3. 鴻\n", tag_demo, "demo-ctext") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. 矢印の形\n", tag_demo, "demo-arrow") +txt.insert('end', "4. √違綵\n", tag_demo, "demo-arrow") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. ルーラー\n", tag_demo, "demo-ruler") +txt.insert('end', "5. 若\n", tag_demo, "demo-ruler") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. フロアプラン\n", tag_demo, "demo-floor") +txt.insert('end', "6. ≪\n", tag_demo, "demo-floor") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "7. フロアプラン (異なるキャンバスアイテム作成方法を使用)\n", tag_demo, "demo-floor2") +txt.insert('end', "7. ≪ (違c潟鴻≪ゃ篏号篏睡)\n", tag_demo, "demo-floor2") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "8. スクロール可能なキャンバス\n", +txt.insert('end', "8. 鴻若純c潟\n", tag_demo, "demo-cscroll") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "9. チェスボード上の騎士の巡回 (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "9. с鴻若筝薑紕綏≦ (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo, "demo-knightstour") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -#txt.insert('end', "スケールとプログレスバー\n", tag_middle) -txt.insert('end', "スケールとプログレスバー\n", tag_kanji_title) +#txt.insert('end', "鴻宴若違鴻\n", tag_middle) +txt.insert('end', "鴻宴若違鴻\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. 垂直スケール\n", tag_demo.id, "demo-vscale") +txt.insert('end', "1. 眼鴻宴若\n", tag_demo.id, "demo-vscale") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. 水平スケール\n", tag_demo.id, "demo-hscale") +txt.insert('end', "2. 羂翫抗鴻宴若\n", tag_demo.id, "demo-hscale") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. プログレスバー (Tile/Ttk拡張への対応が必要)\n", tag_demo.id, "demo-ttkprogress") +txt.insert('end', "3. 違鴻 (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo.id, "demo-ttkprogress") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -txt.insert('end', "ペインドウィンドウとノートブック\n", tag_kanji_title) +txt.insert('end', "ゃ潟c潟若\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. 水平方向 (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "1. 羂翫抗劫 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo.id, "demo-paned1") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. 垂直方向 (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "2. 贋劫 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo.id, "demo-paned2") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. テーマに対応した埋め込みペイン (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "3. 若絲上莨若帥ゃ (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo.id, "demo-ttkpane") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. ノートブックウィジェット (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "4. 若c吾с (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo.id, "demo-ttknote") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -#txt.insert('end', "メニューとツールバー\n", tag_middle) -txt.insert('end', "メニューとツールバー\n", tag_kanji_title) +#txt.insert('end', "<ャ若若\n", tag_middle) +txt.insert('end', "<ャ若若\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. メニューとカスケードを含んだウィンドウ\n", +txt.insert('end', "1. <ャ若鴻宴若c潟\n", tag_demo, "demo-menu") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. メニューとカスケードを含んだウィンドウ (Tk8.x 専用)\n", +txt.insert('end', "2. <ャ若鴻宴若c潟 (Tk8.x 絨)\n", tag_demo, "demo-menu8x") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. 〃 (機能に対応したバージョンのTkが必要)\n", +txt.insert('end', "3. (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-menu84") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. メニューボタン (Tk8.x 専用)\n", +txt.insert('end', "4. <ャ若帥 (Tk8.x 絨)\n", tag_demo, "demo-menubu") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "5. テーマに対応したメニューボタン (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "5. 若絲上<ャ若帥 (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo.id, "demo-ttkmenu") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "6. テーマに対応したツールバー (Tile/Ttk拡張への対応が必要)\n", +txt.insert('end', "6. 若絲上若 (Tile/Ttk≦宍吾絲上綽荀)\n", tag_demo.id, "demo-toolbar") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -#txt.insert('end', "ダイアログウィンドウ\n", tag_middle) -txt.insert('end', "ダイアログウィンドウ\n", tag_kanji_title) +#txt.insert('end', "ゃ≪違c潟\n", tag_middle) +txt.insert('end', "ゃ≪違c潟\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. メッセージボックス\n", tag_demo, "demo-msgbox") +txt.insert('end', "1. <祉若吾\n", tag_demo, "demo-msgbox") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. 詳細テキスト付きのメッセージボックス (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-msgbox2") +txt.insert('end', "2. 荅括完鴻篁<祉若吾 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-msgbox2") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. ファイル選択ダイアログ\n", tag_demo, "demo-filebox") +txt.insert('end', "3. <ゃ御ゃ≪\n", tag_demo, "demo-filebox") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. 色選択ダイアログ\n", tag_demo, "demo-clrpick") +txt.insert('end', "4. 臥御ゃ≪\n", tag_demo, "demo-clrpick") txt.insert('end', " \n ", tag_demospace) txt.insert('end', "\n") -#txt.insert('end', "アニメーション\n", tag_middle) -txt.insert('end', "アニメーション\n", tag_kanji_title) +#txt.insert('end', "≪<若激с\n", tag_middle) +txt.insert('end', "≪<若激с\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. アニメーションラベル (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-anilabel") +txt.insert('end', "1. ≪<若激с潟 (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-anilabel") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. 波形のアニメーション (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-aniwave") +txt.insert('end', "2. 羈√就≪<若激с (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-aniwave") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. 振り子のシミュレーション (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-pendulum") +txt.insert('end', "3. 絖激ャ若激с (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-pendulum") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "4. A celebration of Rube Goldberg (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-goldberg") +txt.insert('end', "4. A celebration of Rube Goldberg (罘純絲上若吾с潟Tk綽荀)\n", tag_demo, "demo-goldberg") txt.insert('end', "\n") -#txt.insert('end', "その他\n", tag_middle) -txt.insert('end', "その他\n", tag_kanji_title) +#txt.insert('end', "篁\n", tag_middle) +txt.insert('end', "篁\n", tag_kanji_title) txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "1. 組み込みのビットマップ\n", tag_demo, "demo-bitmap") +txt.insert('end', "1. 腟粋昭帥\n", tag_demo, "demo-bitmap") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "2. モーダルダイアログ(ローカルグラブ)\n", +txt.insert('end', "2. ≪若ゃ≪(若違)\n", tag_demo, "demo-dialog1") txt.insert('end', " \n ", tag_demospace) -txt.insert('end', "3. モーダルダイアログ(グローバルグラブ)\n", +txt.insert('end', "3. ≪若ゃ≪(違若違)\n", tag_demo, "demo-dialog2") txt.insert('end', " \n ", tag_demospace) @@ -545,13 +545,13 @@ txt.state('disabled') scr.focus ################################ -# method 定義 +# method 絎臂 ################################ def positionWindow(w) w.geometry('+300+300') end -# 親ウィジェットと,変数名と TkVariable との組(配列)の並びを渡す +# 荀c吾с鐚紊医 TkVariable 腟()筝潟羝< $showVarsWin = {} def showVars1(parent, *args) if $showVarsWin[parent.path] @@ -564,7 +564,7 @@ def showVars1(parent, *args) title "Variable values" base = TkFrame.new(w).pack(:fill=>:both, :expand=>true) TkLabel.new(base) { - text "変数値:" + text "紊医:" width 20 anchor 'center' if $tk_version =~ /^4.*/ @@ -586,7 +586,7 @@ def showVars1(parent, *args) }.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x') } TkButton.new(base) { - text "了解" + text "篋茹" command proc{w.destroy} }.pack('side'=>'bottom', 'pady'=>2) } @@ -605,7 +605,7 @@ def showVars2(parent, *args) base = TkFrame.new(top).pack(:fill=>:both, :expand=>true) - TkLabelFrame.new(base, :text=>"変数値:", + TkLabelFrame.new(base, :text=>"紊医:", :font=>{:family=>'Helvetica', :size=>14}){|f| args.each{|vnam,vbody| TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'), @@ -617,7 +617,7 @@ def showVars2(parent, *args) f.grid_columnconfig(1, :weight=>1) f.grid_rowconfig(100, :weight=>1) } - TkButton.new(base, :text=>"了解", :width=>8, :default=>:active, + TkButton.new(base, :text=>"篋茹", :width=>8, :default=>:active, :command=>proc{top.destroy}){|b| top.bind('Return', proc{b.invoke}) top.bind('Escape', proc{b.invoke}) @@ -637,7 +637,7 @@ else # ver >= 8.4 alias showVars showVars2 end -# 疑似トップレベルサポート +# 篌若泣若 module PseudoToplevel_Evaluable def pseudo_toplevel_eval(body = Proc.new) Thread.current[:TOPLEVEL] = self @@ -743,7 +743,7 @@ def eval_samplecode(code, file=nil) Tk.update end -# テキスト上での click に対する動作 +# 鴻筝с click 絲障篏 def invoke(txt, idx) tag = txt.tag_names(idx).find{|t| t.kind_of?(String) && t =~ /^demo-/} return unless tag @@ -776,7 +776,7 @@ def invoke (txt, idx) end =end -# 状態表示 +# 倶茵腓 def showStatus (txt, index) tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/} cursor = txt.cget('cursor') @@ -786,13 +786,13 @@ def showStatus (txt, index) else demoname = tag[5..-1] $statusBarLabel.configure('text', - "サンプルプログラム \"#{demoname}\" の実行 ") + "泣潟違 \"#{demoname}\" 絎茵 ") newcursor = 'hand2' end txt.configure('cursor'=>newcursor) if cursor != newcursor end -# ソースコードの表示 +# 純若鴻潟若茵腓 def showCode1(demo) file = "#{demo}.rb" $code_window = nil unless defined? $code_window @@ -801,15 +801,15 @@ def showCode1(demo) f = TkFrame.new($code_window) TkButton.new(f) { - #text "了解" - text "閉じる" + #text "篋茹" + text "" command proc{ $code_window.destroy $code_window = nil } }.pack('side'=>'right', 'expand'=>'false', 'pady'=>2) TkButton.new(f) { - text "再実行" + text "絎茵" # command proc{eval($code_text.get('1.0','end'), _null_binding)} command proc{eval_samplecode($code_text.get('1.0','end'), '')} }.pack('side'=>'right', 'expand'=>'false', 'pady'=>2) @@ -924,17 +924,17 @@ def showCode2(demo) posnum.text = pos } - #b_dis = TkButton.new(bf, :text=>'了解', :default=>:active, - b_dis = TkButton.new(bf, :text=>'閉じる', :default=>:active, + #b_dis = TkButton.new(bf, :text=>'篋茹', :default=>:active, + b_dis = TkButton.new(bf, :text=>'', :default=>:active, :command=>proc{ $code_window.destroy $code_window = nil }, :image=>$image['delete'], :compound=>:left) - b_prn = TkButton.new(bf, :text=>'印刷', + b_prn = TkButton.new(bf, :text=>'医', :command=>proc{printCode($code_text, file)}, :image=>$image['print'], :compound=>:left) - b_run = TkButton.new(bf, :text=>'再実行', + b_run = TkButton.new(bf, :text=>'絎茵', :command=>proc{ # eval($code_text.get('1.0','end'), _null_binding) eval_samplecode($code_text.get('1.0','end'), '') @@ -1012,27 +1012,27 @@ def printCode(txt, file) msg = `lp -c #{fname}` unless $?.exitstatus == 0 Tk.messageBox(:title=>'Print spooling failure', - :message=>'エラーが発生しました.' + - '印刷に失敗したものと思われます : ' + msg) + :message=>'若榊障鐚' + + '医激紊掩障 : ' + msg) end when 'windows' begin printTextWin32(fname) rescue => e Tk.messageBox(:title=>'Print spooling failure', - :message=>'エラーが発生しました.' + - '印刷に失敗したものと思われます : ' + + :message=>'若榊障鐚' + + '医激紊掩障 : ' + e.message) end when 'macintosh' Tk.messageBox(:title=>'Operation not Implemented', - :message=>'印刷機能はまだ実装されていません') + :message=>'医傑純障絎茖障') else Tk.messageBox(:title=>'Operation not Implemented', - :message=>'検出された環境 ' + + :message=>'罎冴医 ' + Tk::TCL_PLATFORM('platform') + - ' は未知の環境であるため,' + - '印刷機能は実装されていません: ') + ' ャ医с鐚' + + '医傑純絎茖障: ') end ensure File.delete(fname) @@ -1074,7 +1074,7 @@ end # def aboutBox Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo', - 'message'=>"Ruby/Tk ウィジェットデモ Ver.1.7.1-jp\n\n" + + 'message'=>"Ruby/Tk c吾с Ver.1.7.1-jp\n\n" + "based on demos of Tk8.1 -- 8.5 " + "( Copyright of Tcl/Tk demos:: " + "(c) 1996-1997 Sun Microsystems, Inc. / " + @@ -1087,7 +1087,7 @@ def aboutBox end #################################### -# 引数で指定されたデモを起動する +# 綣違ф絎≪莎桁 no_launcher = false if ARGV[0] == '-n' ARGV.shift @@ -1118,5 +1118,5 @@ if no_launcher end ################################ -# イベント待ちに入る +# ゃ潟緇<ャ Tk.mainloop diff --git a/ext/tk/sample/msgs_rb2/ja.msg b/ext/tk/sample/msgs_rb2/ja.msg index 84e89aa6ef..54a105b61f 100644 --- a/ext/tk/sample/msgs_rb2/ja.msg +++ b/ext/tk/sample/msgs_rb2/ja.msg @@ -1,85 +1,85 @@ TkMsgCatalog.new('::tkmsgcat_demo') { - ja 'Application Error', 'アプリケーションエラー', 'euc-jp' - ja 'Blue', '青', 'euc-jp' - ja 'Color', '色選択', 'euc-jp' - ja 'Delete', '消去', 'euc-jp' - ja 'Error', 'エラー', 'euc-jp' - ja 'Exit', '終了', 'euc-jp' - ja 'Green', '緑', 'euc-jp' - ja 'Red', '赤', 'euc-jp' - ja 'blue', '青', 'euc-jp' - ja 'green', '緑', 'euc-jp' - ja 'red', '赤', 'euc-jp' + ja 'Application Error', '≪宴若激с潟', 'utf-8' + ja 'Blue', '', 'utf-8' + ja 'Color', '臥御', 'utf-8' + ja 'Delete', '羔サ', 'utf-8' + ja 'Error', '', 'utf-8' + ja 'Exit', '腟篋', 'utf-8' + ja 'Green', '膩', 'utf-8' + ja 'Red', '莎', 'utf-8' + ja 'blue', '', 'utf-8' + ja 'green', '膩', 'utf-8' + ja 'red', '莎', 'utf-8' } TkMsgCatalog.new('::tk') { - ja "&Abort", '中止', 'euc-jp' + ja "&Abort", '筝罩', 'utf-8' ja "About..." - ja "All Files", 'すべてのファイル', 'euc-jp' - ja "Application Error", 'アプリケーションエラー', 'euc-jp' - ja "&Blue", '青', 'euc-jp' - ja "&Cancel", '取り消し', 'euc-jp' - ja "Cannot change to the directory \"%1\$s\".\nPermission denied.", "ディレクトリ \"%1\$s\" に変更できません.\n許可がありません.", 'euc-jp' - ja "Choose Directory", 'ディレクトリを選択', 'euc-jp' - ja "Clear", '消去', 'euc-jp' - ja "Color", '色', 'euc-jp' - ja "Console", 'コンソール', 'euc-jp' - ja "Copy", 'コピー', 'euc-jp' - ja "Cut", '切り取り', 'euc-jp' - ja "Delete", '消去', 'euc-jp' - ja "Details >>", '詳細 >>', 'euc-jp' - ja "Directory \"%1\$s\" does not exist.", '"%1$s" というディレクトリは存在しません.', 'euc-jp' - ja "&Directory:", 'ディレクトリ', 'euc-jp' + ja "All Files", '鴻<ゃ', 'utf-8' + ja "Application Error", '≪宴若激с潟', 'utf-8' + ja "&Blue", '', 'utf-8' + ja "&Cancel", '羔', 'utf-8' + ja "Cannot change to the directory \"%1\$s\".\nPermission denied.", "c \"%1\$s\" 紊眼с障鐚\n荐怨障鐚", 'utf-8' + ja "Choose Directory", 'c御', 'utf-8' + ja "Clear", '羔サ', 'utf-8' + ja "Color", '', 'utf-8' + ja "Console", '潟潟純若', 'utf-8' + ja "Copy", '潟', 'utf-8' + ja "Cut", '', 'utf-8' + ja "Delete", '羔サ', 'utf-8' + ja "Details >>", '荅括完 >>', 'utf-8' + ja "Directory \"%1\$s\" does not exist.", '"%1$s" c絖障鐚', 'utf-8' + ja "&Directory:", 'c', 'utf-8' ja "Error: %1\$s" - ja "Exit", '終了', 'euc-jp' - ja "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "\"%1\$s\" というファイルは既に存在しています.\n書き換えますか?", 'euc-jp' - ja "File \"%1\$s\" already exists.\n\n", "\"%1\$s\" というファイルは既に存在しています.\n\n", 'euc-jp' - ja "File \"%1\$s\" does not exist.", '"%1$s" というファイルは存在しません.', 'euc-jp' - ja "File &name:", 'ファイル名', 'euc-jp' - ja "File &names:", 'ファイル名', 'euc-jp' - ja "Files of &type:", 'ファイル形式', 'euc-jp' - ja "Fi&les:", 'ファイル', 'euc-jp' - ja "&Filter", 'フィルター', 'euc-jp' - ja "Fil&ter:", 'フィルター', 'euc-jp' - ja "&Green", '緑', 'euc-jp' - ja "Hi", 'こんにちは', 'euc-jp' - ja "Hide Console", 'コンソールを隠す', 'euc-jp' - ja "&Ignore", '無視', 'euc-jp' - ja "Invalid file name \"%1\$s\".", '"%1$s" は不正なファイル名です.', 'euc-jp' - ja "Log Files", 'ログファイル', 'euc-jp' - ja "&No", 'いいえ', 'euc-jp' - ja "&OK", '了解', 'euc-jp' - ja "OK", '了解', 'euc-jp' - ja "Ok", '了解', 'euc-jp' - ja "Open", '開く', 'euc-jp' - ja "&Open", '開く', 'euc-jp' - ja "Open Multiple Files", '複数のファイルを開く', 'euc-jp' - ja "Paste", '貼り付け', 'euc-jp' - ja "Quit", '終了', 'euc-jp' - ja "&Red", '赤', 'euc-jp' - ja "Replace existing file?", '既存のファイルを置き換えますか?', 'euc-jp' - ja "&Retry", '再実行', 'euc-jp' - ja "&Save", '保存', 'euc-jp' - ja "Save As", '名前を付けて保存', 'euc-jp' - ja "Save To Log", 'ログを保存', 'euc-jp' - ja "Select Log File", 'ログファイルを選択', 'euc-jp' - ja "Select a file to source", 'ソースファイルを選択', 'euc-jp' - ja "&Selection:", '選択', 'euc-jp' - ja "Skip Messages", 'メッセージをとばす', 'euc-jp' - ja "Source...", 'ソース...', 'euc-jp' - ja "Tcl Scripts", 'Tcl スクリプト', 'euc-jp' + ja "Exit", '腟篋', 'utf-8' + ja "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "\"%1\$s\" <ゃ≪絖障鐚\n吾障鐚", 'utf-8' + ja "File \"%1\$s\" already exists.\n\n", "\"%1\$s\" <ゃ≪絖障鐚\n\n", 'utf-8' + ja "File \"%1\$s\" does not exist.", '"%1$s" <ゃ絖障鐚', 'utf-8' + ja "File &name:", '<ゃ', 'utf-8' + ja "File &names:", '<ゃ', 'utf-8' + ja "Files of &type:", '<ゃ綵√', 'utf-8' + ja "Fi&les:", '<ゃ', 'utf-8' + ja "&Filter", 'c帥', 'utf-8' + ja "Fil&ter:", 'c帥', 'utf-8' + ja "&Green", '膩', 'utf-8' + ja "Hi", '<', 'utf-8' + ja "Hide Console", '潟潟純若', 'utf-8' + ja "&Ignore", '∴', 'utf-8' + ja "Invalid file name \"%1\$s\".", '"%1$s" 筝罩c<ゃс鐚', 'utf-8' + ja "Log Files", '違<ゃ', 'utf-8' + ja "&No", '', 'utf-8' + ja "&OK", '篋茹', 'utf-8' + ja "OK", '篋茹', 'utf-8' + ja "Ok", '篋茹', 'utf-8' + ja "Open", '', 'utf-8' + ja "&Open", '', 'utf-8' + ja "Open Multiple Files", '茲違<ゃ', 'utf-8' + ja "Paste", '莢若篁', 'utf-8' + ja "Quit", '腟篋', 'utf-8' + ja "&Red", '莎', 'utf-8' + ja "Replace existing file?", '√<ゃ臀障鐚', 'utf-8' + ja "&Retry", '絎茵', 'utf-8' + ja "&Save", '篆絖', 'utf-8' + ja "Save As", '篁篆絖', 'utf-8' + ja "Save To Log", '違篆絖', 'utf-8' + ja "Select Log File", '違<ゃ御', 'utf-8' + ja "Select a file to source", '純若鴻<ゃ御', 'utf-8' + ja "&Selection:", '御', 'utf-8' + ja "Skip Messages", '<祉若吾違', 'utf-8' + ja "Source...", '純若...', 'utf-8' + ja "Tcl Scripts", 'Tcl 鴻', 'utf-8' ja "Tcl for Windows" - ja "Text Files", 'テキストファイル', 'euc-jp' - ja "&Yes", 'はい', 'euc-jp' - ja "abort", '中止', 'euc-jp' - ja "blue", '青', 'euc-jp' - ja "cancel", '取り消し', 'euc-jp' - ja "extension", '拡張子', 'euc-jp' - ja "extensions", '拡張子', 'euc-jp' - ja "green", '緑', 'euc-jp' - ja "ignore", '無視', 'euc-jp' - ja "ok", '了解', 'euc-jp' - ja "red", '赤', 'euc-jp' - ja "retry", '再実行', 'euc-jp' - ja "yes", 'はい', 'euc-jp' + ja "Text Files", '鴻<ゃ', 'utf-8' + ja "&Yes", '', 'utf-8' + ja "abort", '筝罩', 'utf-8' + ja "blue", '', 'utf-8' + ja "cancel", '羔', 'utf-8' + ja "extension", '≦宍絖', 'utf-8' + ja "extensions", '≦宍絖', 'utf-8' + ja "green", '膩', 'utf-8' + ja "ignore", '∴', 'utf-8' + ja "ok", '篋茹', 'utf-8' + ja "red", '莎', 'utf-8' + ja "retry", '絎茵', 'utf-8' + ja "yes", '', 'utf-8' } diff --git a/ext/tk/sample/tcltklib/sample0.rb b/ext/tk/sample/tcltklib/sample0.rb index cd4c8069b4..0ac303ae9e 100644 --- a/ext/tk/sample/tcltklib/sample0.rb +++ b/ext/tk/sample/tcltklib/sample0.rb @@ -1,18 +1,18 @@ #! /usr/local/bin/ruby -vd -# tcltklib ライブラリのテスト +# tcltklib ゃ鴻 require "tcltklib" def test - # インタプリタを生成する + # ゃ潟帥帥 ip1 = TclTkIp.new() - # 評価してみる + # 荅箴<帥 print ip1._return_value().inspect, "\n" print ip1._eval("puts {abc}").inspect, "\n" - # ボタンを作ってみる + # 帥潟篏c帥 print ip1._return_value().inspect, "\n" print ip1._eval("button .lab -text exit -command \"destroy .\"").inspect, "\n" @@ -20,12 +20,12 @@ def test print ip1._eval("pack .lab").inspect, "\n" print ip1._return_value().inspect, "\n" - # インタプリタから ruby コマンドを評価してみる + # ゃ潟帥帥 ruby 潟潟荅箴<帥 # print ip1._eval(%q/ruby {print "print by ruby\n"}/).inspect, "\n" print ip1._eval(%q+puts [ruby {print "print by ruby\n"; "puts by tcl/tk"}]+).inspect, "\n" print ip1._return_value().inspect, "\n" - # もう一つインタプリタを生成してみる + # 筝ゃゃ潟帥帥帥 ip2 = TclTkIp.new() ip2._eval("button .lab -text test -command \"puts test ; destroy .\"") ip2._eval("pack .lab") diff --git a/ext/tk/sample/tcltklib/sample1.rb b/ext/tk/sample/tcltklib/sample1.rb index 1965781533..3235edfe0d 100644 --- a/ext/tk/sample/tcltklib/sample1.rb +++ b/ext/tk/sample/tcltklib/sample1.rb @@ -1,131 +1,131 @@ #! /usr/local/bin/ruby -d -# -*- encoding: euc-jp -*- -# -d オプションを付けると, デバッグ情報を表示する. +# -*- encoding: utf-8 -*- +# -d 激с潟篁, 井宴茵腓冴. -# tcltk ライブラリのサンプル +# tcltk ゃ泣潟 -# まず, ライブラリを require する. +# 障, ゃ require . require "tcltk" -# 以下は, Test1 のインスタンスの initialize() で, -# tcl/tk に関する処理を行う例である. -# 必ずしもそのようにする必要は無く, -# (もし, そうしたければ) class の外で tcl/tk に関する処理を行っても良い. +# 篁ヤ, Test1 ゃ潟鴻帥潟鴻 initialize() , +# tcl/tk ≪茵箴с. +# 綽綽荀<, +# (, ) class 紊 tcl/tk ≪茵c. class Test1 - # 初期化(インタプリタを生成してウィジェットを生成する). + # (ゃ潟帥帥c吾с). def initialize() - #### 使う前のおまじない + #### 篏帥障 - # インタプリタの生成. + # ゃ潟帥帥. ip = TclTkInterpreter.new() - # コマンドに対応するオブジェクトを c に設定しておく. + # 潟潟絲上吾с c 荐絎. c = ip.commands() - # 使用するコマンドに対応するオブジェクトは変数に入れておく. + # 篏睡潟潟絲上吾с紊違ャ. append, bind, button, destroy, incr, info, label, place, set, wm = c.values_at( "append", "bind", "button", "destroy", "incr", "info", "label", "place", "set", "wm") - #### tcl/tk のコマンドに対応するオブジェクト(TclTkCommand)の操作 + #### tcl/tk 潟潟絲上吾с(TclTkCommand)篏 - # 実行する時は, e() メソッドを使う. - # (以下は, tcl/tk における info command r* を実行.) + # 絎茵, e() <純篏帥. + # (篁ヤ, tcl/tk info command r* 絎茵.) print info.e("command", "r*"), "\n" - # 引数は, まとめた文字列にしても同じ. + # 綣違, 障絖. print info.e("command r*"), "\n" - # 変数を用いなくとも実行できるが, 見ためが悪い. + # 紊違絎茵с, 荀. print c["info"].e("command", "r*"), "\n" - # インタプリタのメソッドとしても実行できるが, 効率が悪い. + # ゃ潟帥帥<純絎茵с, 合. print ip.info("command", "r*"), "\n" #### - # 以下, 生成したオブジェクトは変数に代入しておかないと - # GC の対象になってしまう. + # 篁ヤ, 吾с紊違篁eャ + # GC 絲乗院c障. - #### tcl/tk の変数に対応するオブジェクト(TclTkVariable)の操作 + #### tcl/tk 紊違絲上吾с(TclTkVariable)篏 - # 生成と同時に値を設定する. + # ゃ荐絎. v1 = TclTkVariable.new(ip, "20") - # 読み出しは get メソッドを使う. + # 茯水冴 get <純篏帥. print v1.get(), "\n" - # 設定は set メソッドを使う. + # 荐絎 set <純篏帥. v1.set(40) print v1.get(), "\n" - # set コマンドを使って読み出し, 設定は可能だが見ためが悪い. - # e() メソッド等の引数に直接 TclTkObject や数値を書いても良い. + # set 潟潟篏帥c茯水冴, 荐絎純荀. + # e() <純膈綣違贋・ TclTkObject 医ゃ吾. set.e(v1, 30) print set.e(v1), "\n" - # tcl/tk のコマンドで変数を操作できる. + # tcl/tk 潟潟у違篏с. incr.e(v1) print v1.get(), "\n" append.e(v1, 10) print v1.get(), "\n" - #### tcl/tk のウィジェットに対応するオブジェクト(TclTkWidget)の操作 + #### tcl/tk c吾с絲上吾с(TclTkWidget)篏 - # ルートウィジェットを取り出す. + # 若c吾с冴. root = ip.rootwidget() - # ウィジェットの操作. + # c吾с篏. root.e("configure -height 300 -width 300") - # タイトルを付けるときは wm を使う. + # 帥ゃ篁 wm 篏帥. wm.e("title", root, $0) - # 親ウィジェットとコマンドを指定して, ウィジェットを作る. + # 荀c吾с潟潟絎, c吾с篏. l1 = TclTkWidget.new(ip, root, label, "-text {type `x' to print}") - # place すると表示される. + # place 茵腓冴. place.e(l1, "-x 0 -rely 0.0 -relwidth 1 -relheight 0.1") - # コマンド名は文字列で指定しても良いが, 見ためが悪い. - # (コマンド名は独立した引数でなければならない.) + # 潟潟絖ф絎, 荀. + # (潟潟腴綣違с違.) l2 = TclTkWidget.new(ip, root, "label") - # ウィジェットの操作. + # c吾с篏. l2.e("configure -text {type `q' to exit}") place.e(l2, "-x 0 -rely 0.1 -relwidth 1 -relheight 0.1") - #### tcl/tk のコールバックに対応するオブジェクト(TclTkCallback)の操作 + #### tcl/tk 潟若絲上吾с(TclTkCallback)篏 - # コールバックを生成する. + # 潟若. c1 = TclTkCallback.new(ip, proc{sample(ip, root)}) - # コールバックを持つウィジェットを生成する. + # 潟若ゃc吾с. b1 = TclTkWidget.new(ip, root, button, "-text sample -command", c1) place.e(b1, "-x 0 -rely 0.2 -relwidth 1 -relheight 0.1") - # イベントループを抜けるには destroy.e(root) する. + # ゃ潟若 destroy.e(root) . c2 = TclTkCallback.new(ip, proc{destroy.e(root)}) b2 = TclTkWidget.new(ip, root, button, "-text exit -command", c2) place.e(b2, "-x 0 -rely 0.3 -relwidth 1 -relheight 0.1") - #### イベントのバインド - # script の追加 (bind tag sequence +script) は今のところできない. - # (イテレータ変数の設定がうまくいかない.) + #### ゃ潟ゃ潟 + # script 菴遵 (bind tag sequence +script) 篁с. + # (ゃ若水違荐絎障.) - # 基本的にはウィジェットに対するコールバックと同じ. + # 堺c吾с絲障潟若. c3 = TclTkCallback.new(ip, proc{print("q pressed\n"); destroy.e(root)}) bind.e(root, "q", c3) - # bind コマンドで % 置換によりパラメータを受け取りたいときは, - # proc{} の後ろに文字列で指定すると, - # 置換結果をイテレータ変数を通して受け取ることができる. - # ただし proc{} の後ろの文字列は, - # bind コマンドに与えるコールバック以外で指定してはいけない. + # bind 潟潟 % 臀<若帥, + # proc{} 緇絖ф絎, + # 臀腟ゃ若水違с. + # proc{} 緇絖, + # bind 潟潟筝潟若篁ュф絎. c4 = TclTkCallback.new(ip, proc{|i| print("#{i} pressed\n")}, "%A") bind.e(root, "x", c4) - # TclTkCallback を GC の対象にしたければ, - # dcb() (または deletecallbackkeys()) する必要がある. + # TclTkCallback GC 絲乗院, + # dcb() (障 deletecallbackkeys()) 綽荀. cb = [c1, c2, c3, c4] c5 = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, root, w)}, "%W") bind.e(root, "", c5) cb.push(c5) - #### tcl/tk のイメージに対応するオブジェクト(TclTkImage)の操作 + #### tcl/tk ゃ<若吾絲上吾с(TclTkImage)篏 - # データを指定して生成する. + # 若帥絎. i1 = TclTkImage.new(ip, "photo", "-file maru.gif") - # ラベルに張り付けてみる. + # 綣泣篁帥. l3 = TclTkWidget.new(ip, root, label, "-relief raised -image", i1) place.e(l3, "-x 0 -rely 0.4 -relwidth 0.2 -relheight 0.2") - # 空のイメージを生成して後で操作する. + # 腥冴ゃ<若吾緇ф篏. i2 = TclTkImage.new(ip, "photo") - # イメージを操作する. + # ゃ<若吾篏. i2.e("copy", i1) i2.e("configure -gamma 0.5") l4 = TclTkWidget.new(ip, root, label, "-relief raised -image", i2) @@ -134,26 +134,26 @@ class Test1 #### end - # サンプルのためのウィジェットを生成する. + # 泣潟c吾с. def sample(ip, parent) bind, button, destroy, grid, toplevel, wm = ip.commands().values_at( "bind", "button", "destroy", "grid", "toplevel", "wm") ## toplevel - # 新しいウインドウを開くには, toplevel を使う. + # 違ゃ潟, toplevel 篏帥. t1 = TclTkWidget.new(ip, parent, toplevel) - # タイトルを付けておく + # 帥ゃ篁 wm.e("title", t1, "sample") - # ウィジェットが破壊されたとき, コールバックが GC の対象になるようにする. + # c吾с翫, 潟若 GC 絲乗院. cb = [] cb.push(c = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, t1, w)}, "%W")) bind.e(t1, "", c) - # ボタンの生成. + # 帥潟. wid = [] - # toplevel ウィジェットを破壊するには destroy する. + # toplevel c吾с翫 destroy . cb.push(c = TclTkCallback.new(ip, proc{destroy.e(t1)})) wid.push(TclTkWidget.new(ip, t1, button, "-text close -command", c)) cb.push(c = TclTkCallback.new(ip, proc{test_label(ip, t1)})) @@ -183,7 +183,7 @@ class Test1 cb.push(c = TclTkCallback.new(ip, proc{test_canvas(ip, t1)})) wid.push(TclTkWidget.new(ip, t1, button, "-text canvas -command", c)) - # grid で表示する. + # grid ц;腓冴. ro = co = 0 wid.each{|w| grid.e(w, "-row", ro, "-column", co, "-sticky news") @@ -196,38 +196,38 @@ class Test1 end # inittoplevel(ip, parent, title) - # 以下の処理をまとめて行う. - # 1. toplevel ウィジェットを作成する. - # 2. コールバックを登録する配列を用意し, toplevel ウィジェットの - # イベントにコールバックを削除する手続きを登録する. - # 3. クローズボタンを作る. - # 作成した toplevel ウィジェット, クローズボタン, コールバック登録用変数 - # を返す. - # ip: インタプリタ - # parent: 親ウィジェット - # title: toplevel ウィジェットのウインドウのタイトル + # 篁ヤ障茵. + # 1. toplevel c吾с篏. + # 2. 潟若脂蚊, toplevel c吾с + # ゃ潟潟若ゃ膓脂蚊. + # 3. 若冴帥潟篏. + # 篏 toplevel c吾с, 若冴帥, 潟若脂牙紊 + # 菴. + # ip: ゃ潟帥 + # parent: 荀c吾с + # title: toplevel c吾сゃ潟帥ゃ def inittoplevel(ip, parent, title) bind, button, destroy, toplevel, wm = ip.commands().values_at( "bind", "button", "destroy", "toplevel", "wm") - # 新しいウインドウを開くには, toplevel を使う. + # 違ゃ潟, toplevel 篏帥. t1 = TclTkWidget.new(ip, parent, toplevel) - # タイトルを付けておく + # 帥ゃ篁 wm.e("title", t1, title) - # ウィジェットが破壊されたとき, コールバックが GC の対象になるようにする. + # c吾с翫, 潟若 GC 絲乗院. cb = [] cb.push(c = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, t1, w)}, "%W")) bind.e(t1, "", c) - # close ボタンを作っておく. - # toplevel ウィジェットを破壊するには destroy する. + # close 帥潟篏c. + # toplevel c吾с翫 destroy . cb.push(c = TclTkCallback.new(ip, proc{destroy.e(t1)})) b1 = TclTkWidget.new(ip, t1, button, "-text close -command", c) return t1, b1, cb end - # label のサンプル. + # label 泣潟. def test_label(ip, parent) button, global, label, pack = ip.commands().values_at( "button", "global", "label", "pack") @@ -235,7 +235,7 @@ class Test1 ## label - # いろいろな形のラベル. + # 綵≪. l1 = TclTkWidget.new(ip, t1, label, "-text {default(flat)}") l2 = TclTkWidget.new(ip, t1, label, "-text raised -relief raised") l3 = TclTkWidget.new(ip, t1, label, "-text sunken -relief sunken") @@ -244,23 +244,23 @@ class Test1 l6 = TclTkWidget.new(ip, t1, label, "-bitmap error") l7 = TclTkWidget.new(ip, t1, label, "-bitmap questhead") - # pack しても表示される. + # pack 茵腓冴. pack.e(b1, l1, l2, l3, l4, l5, l6, l7, "-pady 3") ## -textvariable - # tcltk ライブラリの実装では, コールバックは tcl/tk の``手続き''を通して - # 呼ばれる. したがって, コールバックの中で(大域)変数にアクセスするときは, - # global する必要がある. - # global する前に変数に値を設定してしまうとエラーになるので, - # tcl/tk における表現形だけ生成して, 実際に値を設定しないように, - # 2 番目の引数には nil を与える. + # tcltk ゃ絎茖с, 潟若 tcl/tk ``膓'' + # 若違. c, 潟若筝(紊у)紊違≪祉鴻, + # global 綽荀. + # global 紊違ゃ荐絎障若, + # tcl/tk 茵憜就, 絎ゃ荐絎, + # 2 綣違 nil 筝. v1 = TclTkVariable.new(ip, nil) global.e(v1) v1.set(100) - # -textvariable で変数を設定する. + # -textvariable у違荐絎. l6 = TclTkWidget.new(ip, t1, label, "-textvariable", v1) - # コールバックの中から変数を操作する. + # 潟若筝紊違篏. cb.push(c = TclTkCallback.new(ip, proc{ global.e(v1); v1.set(v1.get().to_i + 10)})) b2 = TclTkWidget.new(ip, t1, button, "-text +10 -command", c) @@ -270,14 +270,14 @@ class Test1 pack.e(l6, b2, b3) end - # button のサンプル. + # button 泣潟. def test_button(ip, parent) button, pack = ip.commands().values_at("button", "pack") t1, b1, cb = inittoplevel(ip, parent, "button") ## button - # コールバック内で参照する変数は先に宣言しておかなければならない. + # 潟若ус紊違絎h違. b3 = b4 = nil cb.push(c = TclTkCallback.new(ip, proc{b3.e("flash"); b4.e("flash")})) b2 = TclTkWidget.new(ip, t1, button, "-text flash -command", c) @@ -288,7 +288,7 @@ class Test1 pack.e(b1, b2, b3, b4) end - # checkbutton のサンプル. + # checkbutton 泣潟. def test_checkbutton(ip, parent) checkbutton, global, pack = ip.commands().values_at( "checkbutton", "global", "pack") @@ -298,13 +298,13 @@ class Test1 v1 = TclTkVariable.new(ip, nil) global.e(v1) - # -variable で変数を設定する. + # -variable у違荐絎. ch1 = TclTkWidget.new(ip, t1, checkbutton, "-onvalue on -offvalue off", "-textvariable", v1, "-variable", v1) pack.e(b1, ch1) end - # radiobutton のサンプル. + # radiobutton 泣潟. def test_radiobutton(ip, parent) global, label, pack, radiobutton = ip.commands().values_at( "global", "label", "pack", "radiobutton") @@ -314,10 +314,10 @@ class Test1 v1 = TclTkVariable.new(ip, nil) global.e(v1) - # ヌルストリングは "{}" で指定する. + # 鴻潟違 "{}" ф絎. v1.set("{}") l1 = TclTkWidget.new(ip, t1, label, "-textvariable", v1) - # -variable で同じ変数を指定すると同じグループになる. + # -variable у紊違絎違若. ra1 = TclTkWidget.new(ip, t1, radiobutton, "-text radio1 -value r1 -variable", v1) ra2 = TclTkWidget.new(ip, t1, radiobutton, @@ -328,7 +328,7 @@ class Test1 pack.e(b1, l1, ra1, ra2, ra3) end - # scale のサンプル. + # scale 泣潟. def test_scale(ip, parent) global, pack, scale = ip.commands().values_at( "global", "pack", "scale") @@ -339,7 +339,7 @@ class Test1 v1 = TclTkVariable.new(ip, nil) global.e(v1) v1.set(219) - # コールバック内で参照する変数は先に宣言しておかなければならない. + # 潟若ус紊違絎h違. sca1 = nil cb.push(c = TclTkCallback.new(ip, proc{global.e(v1); v = v1.get(); sca1.e("configure -background", format("#%02x%02x%02x", v, v, v))})) @@ -348,7 +348,7 @@ class Test1 pack.e(b1, sca1) end - # entry のサンプル. + # entry 泣潟. def test_entry(ip, parent) button, entry, global, pack = ip.commands().values_at( "button", "entry", "global", "pack") @@ -358,7 +358,7 @@ class Test1 v1 = TclTkVariable.new(ip, nil) global.e(v1) - # ヌルストリングは "{}" で指定する. + # 鴻潟違 "{}" ф絎. v1.set("{}") en1 = TclTkWidget.new(ip, t1, entry, "-textvariable", v1) cb.push(c = TclTkCallback.new(ip, proc{ @@ -367,7 +367,7 @@ class Test1 pack.e(b1, en1, b2) end - # text のサンプル. + # text 泣潟. def test_text(ip, parent) button, pack, text = ip.commands().values_at( "button", "pack", "text") @@ -377,13 +377,13 @@ class Test1 te1 = TclTkWidget.new(ip, t1, text) cb.push(c = TclTkCallback.new(ip, proc{ - # 1 行目の 0 文字目から最後までを表示し, 削除する. + # 1 茵 0 絖緇障с茵腓冴, ゃ. print(te1.e("get 1.0 end")); te1.e("delete 1.0 end")})) b2 = TclTkWidget.new(ip, t1, button, "-text print -command", c) pack.e(b1, te1, b2) end - # raise/lower のサンプル. + # raise/lower 泣潟. def test_raise(ip, parent) button, frame, lower, pack, raise = ip.commands().values_at( "button", "frame", "lower", "pack", "raise") @@ -391,9 +391,9 @@ class Test1 ## raise/lower - # button を隠すテストのために, frame を使う. + # button 鴻, frame 篏帥. f1 = TclTkWidget.new(ip, t1, frame) - # コールバック内で参照する変数は先に宣言しておかなければならない. + # 潟若ус紊違絎h違. b2 = nil cb.push(c = TclTkCallback.new(ip, proc{raise.e(f1, b2)})) b2 = TclTkWidget.new(ip, t1, button, "-text raise -command", c) @@ -405,21 +405,21 @@ class Test1 pack.e(b1, f1) end - # modal なウィジェットのサンプル. + # modal c吾с泣潟. def test_modal(ip, parent) button, frame, message, pack, tk_chooseColor, tk_getOpenFile, tk_messageBox = ip.commands().values_at( "button", "frame", "message", "pack", "tk_chooseColor", "tk_getOpenFile", "tk_messageBox") - # 最初に load されていないライブラリは ip.commands() に存在しないので, - # TclTkLibCommand を生成する必要がある. + # load ゃ ip.commands() 絖, + # TclTkLibCommand 綽荀. tk_dialog = TclTkLibCommand.new(ip, "tk_dialog") t1, b1, cb = inittoplevel(ip, parent, "message/modal") ## message - mes = "これは message ウィジェットのテストです." - mes += "以下は modal なウィジェットのテストです." + mes = " message c吾с鴻с." + mes += "篁ヤ modal c吾с鴻с." me1 = TclTkWidget.new(ip, t1, message, "-text {#{mes}}") ## modal @@ -431,7 +431,7 @@ class Test1 b2 = TclTkWidget.new(ip, t1, button, "-text messageBox -command", c) # tk_dialog cb.push(c = TclTkCallback.new(ip, proc{ - # ウィジェット名を生成するためにダミーの frame を生成. + # c吾с若 frame . print tk_dialog.e(TclTkWidget.new(ip, t1, frame), "dialog dialog error 2 yes no cancel"), "\n"})) b3 = TclTkWidget.new(ip, t1, button, "-text dialog -command", c) @@ -449,7 +449,7 @@ class Test1 pack.e(b1, me1, b2, b3, b4, b5) end - # menu のサンプル. + # menu 泣潟. def test_menu(ip, parent) global, menu, menubutton, pack = ip.commands().values_at( "global", "menu", "menubutton", "pack") @@ -458,29 +458,29 @@ class Test1 ## menu - # menubutton を生成する. + # menubutton . mb1 = TclTkWidget.new(ip, t1, menubutton, "-text menu") - # menu を生成する. + # menu . me1 = TclTkWidget.new(ip, mb1, menu) - # mb1 から me1 が起動されるようにする. + # mb1 me1 莎桁. mb1.e("configure -menu", me1) - # cascade で起動される menu を生成する. + # cascade ц儀 menu . me11 = TclTkWidget.new(ip, me1, menu) - # radiobutton のサンプル. + # radiobutton 泣潟. v1 = TclTkVariable.new(ip, nil); global.e(v1); v1.set("r1") me11.e("add radiobutton -label radio1 -value r1 -variable", v1) me11.e("add radiobutton -label radio2 -value r2 -variable", v1) me11.e("add radiobutton -label radio3 -value r3 -variable", v1) - # cascade により mb11 が起動されるようにする. + # cascade mb11 莎桁. me1.e("add cascade -label cascade -menu", me11) - # checkbutton のサンプル. + # checkbutton 泣潟. v2 = TclTkVariable.new(ip, nil); global.e(v2); v2.set("none") me1.e("add checkbutton -label check -variable", v2) - # separator のサンプル. + # separator 泣潟. me1.e("add separator") - # command のサンプル. + # command 泣潟. v3 = nil cb.push(c = TclTkCallback.new(ip, proc{ global.e(v1, v2, v3); print "v1: ", v1.get(), ", v2: ", v2.get(), @@ -495,7 +495,7 @@ class Test1 pack.e(b1, mb1, om1, "-side left") end - # listbox のサンプル. + # listbox 泣潟. def test_listbox(ip, parent) clipboard, frame, grid, listbox, lower, menu, menubutton, pack, scrollbar, selection = ip.commands().values_at( @@ -506,11 +506,11 @@ class Test1 ## listbox/scrollbar f1 = TclTkWidget.new(ip, t1, frame) - # コールバック内で参照する変数は先に宣言しておかなければならない. + # 潟若ус紊違絎h違. li1 = sc1 = sc2 = nil - # 実行時に, 後ろにパラメータがつくコールバックは, - # イテレータ変数でそのパラメータを受け取ることができる. - # (複数のパラメータはひとつの文字列にまとめられる.) + # 絎茵, 緇<若帥ゃ潟若, + # ゃ若水違с<若帥с. + # (茲違<若帥蚊ゃ絖障.) cb.push(c1 = TclTkCallback.new(ip, proc{|i| li1.e("xview", i)})) cb.push(c2 = TclTkCallback.new(ip, proc{|i| li1.e("yview", i)})) cb.push(c3 = TclTkCallback.new(ip, proc{|i| sc1.e("set", i)})) @@ -532,17 +532,17 @@ class Test1 me1 = TclTkWidget.new(ip, mb1, menu) mb1.e("configure -menu", me1) cb.push(c = TclTkCallback.new(ip, proc{ - # clipboard をクリア. + # clipboard . clipboard.e("clear") - # selection から文字列を読み込み clipboard に追加する. + # selection 絖茯粋昭 clipboard 菴遵. clipboard.e("append {#{selection.e('get')}}")})) me1.e("add command -label {selection -> clipboard} -command",c) cb.push(c = TclTkCallback.new(ip, proc{ - # li1 をクリア. + # li1 . li1.e("delete 0 end") - # clipboard から文字列を取り出し, 1 行ずつ + # clipboard 絖冴, 1 茵 selection.e("get -selection CLIPBOARD").split(/\n/).each{|line| - # li1 に挿入する. + # li1 水ャ. li1.e("insert end {#{line}}")}})) me1.e("add command -label {clipboard -> listbox} -command",c) @@ -557,7 +557,7 @@ class Test1 pack.e(f2, f1) end - # canvas のサンプル. + # canvas 泣潟. def test_canvas(ip, parent) canvas, lower, pack = ip.commands().values_at("canvas", "lower", "pack") t1, b1, cb = inittoplevel(ip, parent, "canvas") @@ -566,36 +566,36 @@ class Test1 ca1 = TclTkWidget.new(ip, t1, canvas, "-width 400 -height 300") lower.e(ca1, b1) - # rectangle を作る. + # rectangle 篏. idr = ca1.e("create rectangle 10 10 20 20") - # oval を作る. + # oval 篏. ca1.e("create oval 60 10 100 50") - # polygon を作る. + # polygon 篏. ca1.e("create polygon 110 10 110 30 140 10") - # line を作る. + # line 篏. ca1.e("create line 150 10 150 30 190 10") - # arc を作る. + # arc 篏. ca1.e("create arc 200 10 250 50 -start 0 -extent 90 -style pieslice") - # i1 は本当は, どこかで破壊しなければならないが, 面倒なので放ってある. + # i1 綵, х翫違, √ф障c. i1 = TclTkImage.new(ip, "photo", "-file maru.gif") - # image を作る. + # image 篏. ca1.e("create image 100 100 -image", i1) - # bitmap を作る. + # bitmap 篏. ca1.e("create bitmap 260 50 -bitmap questhead") - # text を作る. + # text 篏. ca1.e("create text 320 50 -text {drag rectangle}") - # window を作る(クローズボタン). + # window 篏(若冴帥). ca1.e("create window 200 200 -window", b1) - # bind により rectangle を drag できるようにする. + # bind rectangle drag с. cb.push(c = TclTkCallback.new(ip, proc{|i| - # i に x と y を受け取るので, 取り出す. + # i x y , 冴. x, y = i.split(/ /); x = x.to_f; y = y.to_f - # 座標を変更する. + # 綺ф紊眼. ca1.e("coords current #{x - 5} #{y - 5} #{x + 5} #{y + 5}")}, - # x, y 座標を空白で区切ったものをイテレータ変数へ渡すように指定. + # x, y 綺ф腥榊純у阪cゃ若水違御検絎. "%x %y")) - # rectangle に bind する. + # rectangle bind . ca1.e("bind", idr, "", c) pack.e(ca1) @@ -605,7 +605,7 @@ end # test driver if ARGV.size == 0 - print "#{$0} n で, n 個のインタプリタを起動します.\n" + print "#{$0} n , n ゃ潟帥帥莎桁障.\n" n = 1 else n = ARGV[0].to_i @@ -614,16 +614,16 @@ end print "start\n" ip = [] -# インタプリタ, ウィジェット等の生成. +# ゃ潟帥, c吾с膈. for i in 1 .. n ip.push(Test1.new()) end -# 用意ができたらイベントループに入る. +# сゃ潟若ャ. TclTk.mainloop() print "exit from mainloop\n" -# インタプリタが GC されるかのテスト. +# ゃ潟帥帥 GC 鴻. ip = [] print "GC.start\n" if $DEBUG GC.start() if $DEBUG diff --git a/ext/tk/sample/tcltklib/sample2.rb b/ext/tk/sample/tcltklib/sample2.rb index f187d6ce1d..1acc180680 100644 --- a/ext/tk/sample/tcltklib/sample2.rb +++ b/ext/tk/sample/tcltklib/sample2.rb @@ -7,12 +7,12 @@ #--------------------------------------------------------------------------- # Sep. 17, 1997 modified by Y. Shigehiro for tcltk library -# maeda shugo (shugo@po.aianet.ne.jp) 氏による -# (ruby/tk で書かれていた) ruby のサンプルプログラム +# maeda shugo (shugo@po.aianet.ne.jp) 羂 +# (ruby/tk ф吾) ruby 泣潟違 # http://www.aianet.or.jp/~shugo/ruby/othello.rb.gz -# を tcltk ライブラリを使うように, 機械的に変更してみました. +# tcltk ゃ篏帥, 罘罌亥紊眼帥障. # -# なるべくオリジナルと同じになるようにしてあります. +# 鴻吾障. require "observer" require "tcltk" @@ -343,14 +343,14 @@ class Othello @board = Board.new(self) @board_view = BoardView.new(self, @board) #### added by Y. Shigehiro - ## board_view の大きさを設定する. + ## board_view 紊с荐絎. x1, y1, x2, y2 = @board_view.e("bbox all").split(/ /).collect{|i| i.to_f} @board_view.e("configure -width", x2 - x1) @board_view.e("configure -height", y2 - y1) - ## scrollregion を設定する. + ## scrollregion 荐絎. @board_view.e("configure -scrollregion {", @board_view.e("bbox all"), "}") - #### ここまで + #### 障 $pack.e(@board_view, "-fill both -expand true") panel = TclTkWidget.new($ip, $root, $frame) diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/index.html b/ext/tk/sample/tkextlib/tkHTML/page1/index.html index 9efac7f7af..af87289c28 100644 --- a/ext/tk/sample/tkextlib/tkHTML/page1/index.html +++ b/ext/tk/sample/tkextlib/tkHTML/page1/index.html @@ -90,7 +90,7 @@ everything and the Wirth of nothing? All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the Poster. - The Rest 1997-2000 Andover.Net. + The Rest 1997-2000 Andover.Net. diff --git a/ext/tk/sample/tkoptdb-safeTk.rb b/ext/tk/sample/tkoptdb-safeTk.rb index 3972577b0f..7502e30667 100644 --- a/ext/tk/sample/tkoptdb-safeTk.rb +++ b/ext/tk/sample/tkoptdb-safeTk.rb @@ -20,7 +20,7 @@ if ENV['LANG'] =~ /^ja/ # read Japanese resource ent = TkOptionDB.read_entries(File.expand_path('resource.ja', File.dirname(__FILE__)), - 'euc-jp') + 'utf-8') else # read English resource ent = TkOptionDB.read_entries(File.expand_path('resource.en', diff --git a/ext/tk/sample/tkoptdb.rb b/ext/tk/sample/tkoptdb.rb index 75c21e7e47..0171e465b3 100644 --- a/ext/tk/sample/tkoptdb.rb +++ b/ext/tk/sample/tkoptdb.rb @@ -13,7 +13,7 @@ if __FILE__ == $0 || !TkCore::INTERP.safe? # read Japanese resource TkOptionDB.read_with_encoding(File.expand_path('resource.ja', File.dirname(__FILE__)), - 'euc-jp') + 'utf-8') else # read English resource TkOptionDB.readfile(File.expand_path('resource.en', -- cgit v1.2.3