[#26664] refactoring tcltklib.c (deleted ip check) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

22 messages 2005/08/01
[#26665] Re: refactoring tcltklib.c (deleted ip check) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/01

山本です。

[#26668] Re: refactoring tcltklib.c (deleted ip check) — Hidetoshi NAGAI <nagai@...> 2005/08/01

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

[#26678] Re: refactoring tcltklib.c (deleted ip check) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/01

山本です。

[#26684] Re: refactoring tcltklib.c (deleted ip check) — Hidetoshi NAGAI <nagai@...> 2005/08/01

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

[#26686] Re: refactoring tcltklib.c (deleted ip check) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/01

山本です。

[#26817] test/socket/test_tcp.rb freeze on windows — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

12 messages 2005/08/18

[#26829] cannot check EOF of pipe on windows — "U.Nakamura" <usa@...>

こんにちは、なかむら(う)です。

19 messages 2005/08/19
[#26830] Re: cannot check EOF of pipe on windows — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/19

山本です。

[#26831] Re: cannot check EOF of pipe on windows — "U.Nakamura" <usa@...> 2005/08/19

こんにちは、なかむら(う)です。

[#26832] Re: cannot check EOF of pipe on windows — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/19

山本です。

[#26836] Re: cannot check EOF of pipe on windows — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/08/19

なかだです。

[#26872] irb -I/ruby -Iと$LOAD_PATH — akira yamada / やまだあきら <akira@...>

Debianユーザからruby -Iとirb -Iで

17 messages 2005/08/24
[#26873] Re: irb -I/ruby -Iと$LOAD_PATH — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/08/24

なかだです。

[#26875] Re: irb -I/ruby -Iと$LOAD_PATH — akira yamada / やまだあきら <akira@...> 2005/08/24

nobuyoshi nakada wrote:

[#26885] Re: irb -I/ruby -Iと$LOAD_PATH — keiju@... (石塚圭樹) 2005/08/26

けいじゅ@いしつかです.

[#26897] fail on make install — KIMURA Koichi <kimura.koichi@...>

木村です。

28 messages 2005/08/29
[#26898] Re: fail on make install — "U.Nakamura" <usa@...> 2005/08/29

こんにちは、なかむら(う)です。

[#26903] Re: fail on make install — KIMURA Koichi <kbk@...> 2005/08/29

木村です。

[#26922] Re: fail on make install — KIMURA Koichi <kimura.koichi@...> 2005/08/30

木村です。

[#26926] Re: fail on make install — KIMURA Koichi <kimura.koichi@...> 2005/08/31

木村です。

[#26927] Re: fail on make install — "U.Nakamura" <usa@...> 2005/08/31

こんにちは、なかむら(う)です。

[#26928] Re: fail on make install — KIMURA Koichi <kimura.koichi@...> 2005/08/31

木村です。

[#26929] Re: fail on make install — "U.Nakamura" <usa@...> 2005/08/31

こんにちは、なかむら(う)です。

[#26930] Re: fail on make install — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/08/31

なかだです。

[#26931] Re: fail on make install — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/31

山本です。

[#26933] Re: fail on make install — nobu@... 2005/08/31

なかだです。

[#26938] Re: fail on make install — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/09/01

なかだです。

[#26939] Re: fail on make install — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/01

山本です。

[#26900] multiplying empty string — nobuyoshi nakada <nobuyoshi.nakada@...>

19 messages 2005/08/29
[#26904] Re: multiplying empty string — Yukihiro Matsumoto <matz@...> 2005/08/29

まつもと ゆきひろです

[#26907] Re: multiplying empty string — Tanaka Akira <akr@...17n.org> 2005/08/29

In article <1125327516.070646.12845.nullmailer@x31.priv.netlab.jp>,

[#26909] Re: multiplying empty string — Yukihiro Matsumoto <matz@...> 2005/08/29

まつもと ゆきひろです

[ruby-dev:26686] Re: refactoring tcltklib.c (deleted ip check)

From: "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date: 2005-08-01 09:23:24 UTC
List: ruby-dev #26686
山本です。

>> tile 0.4 でまさにそういう状況でしたので、修正してコミットしました。
>
>そうでしたか.
>すみません.チェックしきれていませんでした.

ああ、いえ、[ruby-dev:26665] の私の書いたデモが tile 0.4 で動かなかった
ということでした。紛らわしくてすみません。

一応動くところまで行ったのですが、ライブラリにも変更が必要だったので
確認しておきます。これでいいでしょうか?

* autoload が働いていなかった: TreeView => Treeview (逆にすべき?)

* ary2tk_list がないといってエラーになった。ほかの場所では *items の
  ように展開していたので、それに習った。

あと、Tk::Tile::Treeview の 'heading' コマンド相当を見つけられなかったので
Tk.tk_call で代用しました。それらしいクラスが上のほうにあるのですが、
使い方がわかりませんでした。

# なお、これはまだ tile 0.4 で動くようにできていません。tile 0.4 には
# ツリービューがないようなので、これから対処します。

Index: sample/tkextlib/tile/demo.rb
===================================================================
RCS file: /src/ruby/ext/tk/sample/tkextlib/tile/demo.rb,v
retrieving revision 1.6
diff -u -w -b -p -r1.6 demo.rb
--- sample/tkextlib/tile/demo.rb	1 Aug 2005 06:33:35 -0000	1.6
+++ sample/tkextlib/tile/demo.rb	1 Aug 2005 09:14:52 -0000
@@ -303,6 +303,8 @@ def makeNotebook
 
   combo = Tk::Tile::TFrame.new(nb)
   nb.add(combo, :text=>'Combobox', :underline=>7)
+  tree = Tk::Tile::TFrame.new(nb)
+  nb.add(tree, :text=>'Tree')
   others = Tk::Tile::TFrame.new(nb)
   nb.add(others, :text=>'Others', :underline=>4)
   nb.add(Tk::Tile::TLabel.new(nb, :text=>'Nothing to see here...'), 
@@ -310,10 +312,10 @@ def makeNotebook
   nb.add(Tk::Tile::TLabel.new(nb, :text=>'Nothing to see here either.'), 
          :text=>'More Stuff', :sticky=>:se)
 
-  [nb, client, combo, others]
+  [nb, client, combo, tree, others]
 end
 
-nb, client, combo, others = makeNotebook()
+nb, client, combo, tree, others = makeNotebook()
 
 #
 # Side-by side check, radio, and menu button comparison:
@@ -556,6 +558,45 @@ values = %w(list abc def ghi jkl mno pqr
 }
 
 #
+# Treeview widget demo pane:
+#
+treeview = nil # avoid 'undefined' error
+scrollbar = Tk::Tile::TScrollbar.new(tree,
+    :command=>proc{|*args| treeview.yview(*args)})
+treeview = Tk::Tile::Treeview.new(tree, :columns=>%w(Class), :padding=>4,
+    :yscrollcommand=>proc{|*args| scrollbar.set(*args)})
+
+Tk.grid(treeview, scrollbar, :sticky=>'news')
+tree.grid_columnconfigure(0, :weight=>1)
+tree.grid_rowconfigure(0, :weight=>1)
+tree.grid_propagate(0)
+
+# Add initial tree node: 
+# Later nodes will be added in <<TreeviewOpen>> binding.
+treeview.insert('', 0, :id=>'.', :text=>'Main Window', :open=>false,
+    :values=>[TkWinfo.classname('.')])
+Tk.tk_call(treeview, 'heading', '#0', :text=>'Widget')
+Tk.tk_call(treeview, 'heading', 'Class', :text=>'Class')
+treeview.bind('<TreeviewOpen>', proc{fillTree(treeview)})
+
+def fillTree(treeview)
+  id = treeview.focus_item
+  unless TkWinfo.exist?(id)
+    treeview.delete(id)
+  end
+  # Replace tree item children with current list of child windows.
+  treeview.delete(treeview.children(id))
+  for child in TkWinfo.children(id)
+    treeview.insert(id, :end, :id=>child, :text=>TkWinfo.appname(child),
+        :open=>false, :values=>[TkWinfo.classname(child)])
+    unless TkWinfo.children(child).empty?
+      # insert dummy child to show [+] indicator
+      treeview.insert(child, :end)
+    end
+  end
+end
+
+#
 # Other demos:
 #
 $Timers = {:StateMonitor=>nil, :FocusMonitor=>nil}
Index: lib/tkextlib/tile.rb
===================================================================
RCS file: /src/ruby/ext/tk/lib/tkextlib/tile.rb,v
retrieving revision 1.8
diff -u -w -b -p -r1.8 tile.rb
--- lib/tkextlib/tile.rb	30 May 2005 14:53:45 -0000	1.8
+++ lib/tkextlib/tile.rb	1 Aug 2005 08:08:56 -0000
@@ -142,7 +142,7 @@ module Tk
 
     autoload :TSquare,       'tkextlib/tile/tsquare'
 
-    autoload :TreeView,      'tkextlib/tile/treeview'
+    autoload :Treeview,      'tkextlib/tile/treeview'
 
     autoload :Style,         'tkextlib/tile/style'
   end
Index: lib/tkextlib/tile/treeview.rb
===================================================================
RCS file: /src/ruby/ext/tk/lib/tkextlib/tile/treeview.rb,v
retrieving revision 1.3
diff -u -w -b -p -r1.3 treeview.rb
--- lib/tkextlib/tile/treeview.rb	9 Apr 2005 09:27:52 -0000	1.3
+++ lib/tkextlib/tile/treeview.rb	1 Aug 2005 08:58:47 -0000
@@ -129,17 +129,17 @@ class Tk::Tile::Treeview < TkWindow
     list(tk_send_without_enc('children', item))
   end
   def children=(item, *items)
-    tk_send_without_enc('children', item, ary2tk_list(items))
+    tk_send_without_enc('children', item, *items)
     items
   end
 
   def delete(*items)
-    tk_send_without_enc('delete', ary2tk_list(items))
+    tk_send_without_enc('delete', *items)
     self
   end
 
   def detach(*items)
-    tk_send_without_enc('detach', ary2tk_list(items))
+    tk_send_without_enc('detach', *items)
     self
   end
 
@@ -193,19 +193,19 @@ class Tk::Tile::Treeview < TkWindow
   end
 
   def selection_add(*items)
-    tk_send_without_enc('selection', 'add', ary2tk_list(items))
+    tk_send_without_enc('selection', 'add', *items)
     self
   end
   def selection_remove(*items)
-    tk_send_without_enc('selection', 'remove', ary2tk_list(items))
+    tk_send_without_enc('selection', 'remove', *items)
     self
   end
   def selection_set(*items)
-    tk_send_without_enc('selection', 'set', ary2tk_list(items))
+    tk_send_without_enc('selection', 'set', *items)
     self
   end
   def selection_toggle(*items)
-    tk_send_without_enc('selection', 'toggle', ary2tk_list(items))
+    tk_send_without_enc('selection', 'toggle', *items)
     self
   end


In This Thread