[#25808] break & retry in block — Shin-ichiro HARA <sinara@...>

原です。

15 messages 2005/03/04

[#25812] Re: [ruby-cvs] ruby/test/ruby, ruby/test/logger, ruby/sample, ruby/misc, ruby/lib/xmlrpc, ruby/lib/wsdl/soap, ruby/lib/rexml, ruby/lib/rdoc/parsers, ruby/lib/rdoc/generators, ruby/lib/irb, ruby/lib, ruby/ext/zlib, ruby/ext/win32ole, ruby/ext/tk, ruby/ext/strscan, ruby/ext/socket, ruby/ext/readline, ruby/ext/pty, ruby/ext/openssl, ruby/ext/iconv, ruby/ext/etc, ruby/ext/dl, ruby/ext/curses, ruby/ext/bigdecimal, ruby/ext/Win32API, ruby: * array.c: replace rb_protect_inspect() and rb_inspecting_p() by — Tanaka Akira <akr@...17n.org>

In article <20050304064753.53859C671F@lithium.ruby-lang.org>,

3 messages 2005/03/06

[#25853] conflict method and local variable — Hidetoshi NAGAI <nagai@...>

永井@知能.九工大です.

56 messages 2005/03/10
[#25854] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/10

まつもと ゆきひろです

[#25855] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/10

永井@知能.九工大です.

[#25856] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/10

まつもと ゆきひろです

[#25857] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/11

永井@知能.九工大です.

[#25858] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/11

まつもと ゆきひろです

[#25861] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/11

永井@知能.九工大です.

[#25863] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/11

まつもと ゆきひろです

[#25864] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/11

永井@知能.九工大です.

[#25865] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/11

まつもと ゆきひろです

[#25866] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/11

永井@知能.九工大です.

[#25869] Re: conflict method and local variable — Shugo Maeda <shugo@...> 2005/03/13

前田です。

[#25875] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/13

まつもと ゆきひろです

[#25878] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/13

永井@知能.九工大です.

[#25882] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/13

まつもと ゆきひろです

[#25884] Re: conflict method and local variable — Hidetoshi NAGAI <nagai@...> 2005/03/14

永井@知能.九工大です.

[#25885] Re: conflict method and local variable — Yukihiro Matsumoto <matz@...> 2005/03/14

まつもと ゆきひろです

[#25888] Re: conflict method and local variable — Shugo Maeda <shugo@...> 2005/03/14

前田です。

[#25946] ext/tk/sample/**/*.gif are broken — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

16 messages 2005/03/27

[#25959] some trouble on ext/tk/sample — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

20 messages 2005/03/29
[#25969] Re: some trouble on ext/tk/sample — Hidetoshi NAGAI <nagai@...> 2005/03/30

永井@知能.九工大です.

[#25970] Re: some trouble on ext/tk/sample — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/03/30

山本です。

[#25973] Re: some trouble on ext/tk/sample — Hidetoshi NAGAI <nagai@...> 2005/03/31

永井@知能.九工大です.

[ruby-dev:25970] Re: some trouble on ext/tk/sample

From: "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date: 2005-03-30 18:16:35 UTC
List: ruby-dev #25970
山本です。

>> ////////////////////////
>> // tkextlib/iwidgets/sample/hierarchy.rb
>> 
>> ファイル名が化けている?ActiveTcl付属の同等のデモは動いた。
>
>この件も修正できたと思います.
>「image が見つからない」などと文句を言っているので戸惑いましたが,
>結局は日本語ファイル名の取り扱いの問題でした.
>コールバック処理の中で明示的にエンコーディングの変換を行うように
>しています.

動くようになりました。ただ、各ノードがフルパスなのが気になったので、
ActiveTcl を参考に下のようにしてみました。(意図した挙動でしたらすみません)

Index: hierarchy.rb
===================================================================
RCS file: /src/ruby/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb,v
retrieving revision 1.1.2.3
diff -u -w -b -p -r1.1.2.3 hierarchy.rb
--- hierarchy.rb	30 Mar 2005 15:43:30 -0000	1.1.2.3
+++ hierarchy.rb	30 Mar 2005 16:29:04 -0000
@@ -6,7 +6,7 @@ def get_files(file)
   dir = (file.empty?)? ENV['HOME'] : TkComm._fromUTF8(file)
   Dir.chdir(dir) rescue return ''
   Dir['*'].sort.collect{|f|
-    TkCore::INTERP._merge_tklist(TkComm._toUTF8(File.join(dir, f)))
+    [TkComm._toUTF8(File.join(dir, f)), TkComm._toUTF8(f)]
   }
 end

あと、console の件ですが、HEAD だと妙な警告がでます。

../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1100: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1100: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1102: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1105: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1107: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1109: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1116: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1116: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1118: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1121: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1123: warning: out-of-scope vari
able - i
../ruby/ext/tk/sample/tkextlib/treectrl/demo.rb:1125: warning: out-of-scope vari
able - i

ruby_1_8 だと出ません。妙な、というのは、指定された行に i がないのです。
上のほうにはあるんですけど。

あと、List of Demos をクリックすると、treectrl が -backgroundimage を
サポートしていないというエラーが出ます。ActiveTcl のヘルプを見ると
確かに載っていません。(私の環境では Tk::TreeCtrl.package_version == '1.1' です)

とりあえず下のようにすることで bitmaps 以外のデモは動きました。

Index: demo.rb
===================================================================
RCS file: /src/ruby/ext/tk/sample/tkextlib/treectrl/demo.rb,v
retrieving revision 1.1.2.2
diff -u -w -b -p -r1.1.2.2 demo.rb
--- demo.rb	30 Mar 2005 08:44:55 -0000	1.1.2.2
+++ demo.rb	30 Mar 2005 17:11:57 -0000
@@ -89,7 +89,7 @@ class TkTreeCtrl_demo
   def init_pics(*args)
     args.each{|pat|
       pat = "#{pat}.gif"
-      unless TkImage.names.find{|img| (name = @images.key(img)) && File.fnmatch(pat, name)}
+      unless TkImage.names.find{|img| (name = @images.key?(img)) && File.fnmatch(pat, name)}
         Dir.glob(File.join(@ScriptDir, 'pics', pat)).each{|file|
           name = File.basename(file, '.gif')
           img = TkPhotoImage.new(:file=>file)
@@ -328,20 +328,6 @@ class TkTreeCtrl_demo
       [ 'Expand',   [], nil, '', {:menu_config=>{:tearoff=>false}} ]
     ]
 
-    if (TkPackage.vcompare(Tk::TreeCtrl.package_version, '1.1') >= 0)
-      menuspec << \
-      [ 'Background Image', 
-        [
-          [ 'none', [@popup[:bgimg], 'none'], nil, '', 
-            {:command=>proc{@tree2.backgroundimage = ''}} ], 
-          [ 'sky',  [@popup[:bgimg], 'sky'],  nil, '', 
-            {:command=>proc{
-                @tree2.backgroundimage = @images[@popup[:bgimg].value]}} ]
-        ], 
-        nil, '', {:menu_config=>{:tearoff=>false}}
-      ]
-    end
-
     menuspec.concat([
       [ 'Background Mode', 
         %w(column index row visindex).collect{|val|
@@ -528,9 +514,6 @@ class TkTreeCtrl_demo
     [:data, :display, :enable].each{|k|
       @popup[:debug][k].value = w.debug_cget(k)
     }
-    if (TkPackage.vcompare(Tk::TreeCtrl.package_version, '1.1') >= 0)
-      @popup[:bgimg].value = @images.key(w[:backgroundimage])
-    end
     @popup[:bgmode].value = w[:backgroundmode]
     @popup[:doublebuffer].value = w[:doublebuffer]
     @popup[:linestyle].value = w[:linestyle]
@@ -1071,7 +1054,7 @@ class TkTreeCtrl_demo
                        :xscrolldelay=>50, :yscrolldelay=>50, 
                        :openbuttonimage=>'', :closedbuttonimage=>'', 
                        :backgroundmode=>:row, :treecolumn=>0, :indent=>19, 
-                       :defaultstyle=>'', :backgroundimage=>'')
+                       :defaultstyle=>'')
     else
       @tree2.configure(:orient=>:vertical, :wrap=>'', 
                        :xscrollincrement=>0, :yscrollincrement=>0, 



In This Thread