[#11156] How to delete methods from superclass? — Clemens Hintze <c.hintze@...>

Hello,

25 messages 1998/12/01
[#11157] Re: How to delete methods from superclass? — matz@... (Yukihiro Matsumoto) 1998/12/01

Hi, Clemens.

[#11176] English List [Re: How to delete methods from superclass?] — gotoken@... (GOTO Kentaro) 1998/12/01

In message "[ruby-list:11157] Re: How to delete methods from superclass?"

[#11250] Ruby 用語集 — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

25 messages 1998/12/08

[#11269] 京都 (Re: [ruby-dev:3789] Re: List()) — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

21 messages 1998/12/11
[#11299] Re: 京都 — MAEDA Shugo <shugo@...> 1998/12/12

前田です。

[#11393] mod_ruby — shugo@... (Shugo Maeda)

前田です。

28 messages 1998/12/21
[#11394] Re: mod_ruby — matz@... (Yukihiro Matsumoto) 1998/12/21

まつもと ゆきひろです

[#11398] Re: mod_ruby — shugo@... (Shugo Maeda) 1998/12/21

前田です。

[#11399] RE: mod_ruby — OZAWA Sakuro <crouton@...> 1998/12/21

さくです。

[#11408] Re: Be port — shugo@... (Shugo Maeda) 1998/12/22

前田です。

[#11464] ruby and IDE — Noritsugu Nakamura <nnakamur@...>

18 messages 1998/12/27
[#11465] goto (Re: ruby and IDE) — ttate@... 1998/12/27

立石です。

[ruby-list:11154] Re: tk.rb: font name

From: nagai@...
Date: 1998-12-01 03:27:31 UTC
List: ruby-list #11154
永井@知能.九工大です.

From: nagai@dumbo.ai.kyutech.ac.jp
Subject: [ruby-list:11131] Re: tk.rb: font name
Date: Mon, 30 Nov 1998 11:14:08 +0900
Message-ID: <19981130112013O.nagai@ai.kyutech.ac.jp>
nagai> そうですね.
nagai> この場合まで考慮すると,石井さんの tk_split_list を用いるようにして
nagai> tk8.x の方も対策を施す方が良さそうにも思えます.
nagai> あるいは,それと同等の展開をするように,
nagai> tkfont.rb の中にメソッドを作るかですね.
nagai> 私のパッチは極悪な case を除いては大丈夫であることを期待してますが,
nagai> tk_split_simplelist をうまく使えないかも含めて,
nagai> もう一度考えてみます.

考えてみました.(^_^)
これでいかがでしょうか.
素の 1.1c6 の tkfont.rb からのパッチになってますが,
1.1c9 でも tkfont.rb は変化していないようなので,
そのまま適用できるはずです.

--- ../../../src/ruby-1.1c6/lib/tkfont.rb	Fri Jul 24 17:52:53 1998
+++ tkfont.rb	Mon Nov 30 23:41:24 1998
@@ -26,9 +26,9 @@
 
     when /^8\.*/
       if window
-	list(tk_call('font', 'families', '-displayof', window))
+	tk_split_simplelist(tk_call('font', 'families', '-displayof', window))
       else
-	list(tk_call('font', 'families'))
+	tk_split_simplelist(tk_call('font', 'families'))
       end
     end
   end
@@ -64,7 +64,9 @@
   def TkFont.init_widget_font(path, *args)
     case (Tk::TK_VERSION)
     when /^4\.*/
-      conf = tk_split_list(tk_call(*args))
+      conf = tk_split_simplelist(tk_call(*args)).
+	find_all{|prop| prop[0..5]=='-font ' || prop[0..10]=='-kanjifont '}.
+	collect{|prop| tk_split_simplelist(prop)}
       if font_inf = conf.assoc('-font')
 	ltn = font_inf[4]
 	ltn = nil if ltn == []
@@ -81,11 +83,13 @@
       TkFont.new(ltn, knj).call_font_configure(path, *(args + [{}]))
 
     when /^8\.*/
-      conf = tk_split_list(tk_call(*args))
-      unless font_inf = conf.assoc('-font')
+      font_prop = tk_split_simplelist(tk_call(*args)).find{|prop| 
+	prop[0..5] == '-font '
+      }
+      unless font_prop
 	raise RuntimeError, "unknown option '-font'"
       end
-      fnt = font_inf[4]
+      fnt = tk_split_simplelist(font_prop)[4]
       if fnt == []
 	TkFont.new(nil, nil).call_font_configure(path, *(args + [{}]))
       else
@@ -343,7 +347,7 @@
     if JAPANIZED_TK
       @fontslot = {'font'=>@compoundfont}
       tk_call('font', 'create', @compoundfont, 
-	      '-compound', "#{@latinfont} #{@kanjifont}", *hash_kv(keys))
+	      '-compound', [@latinfont, @kanjifont], *hash_kv(keys))
     else
       tk_call('font', 'create', @compoundfont)
       latinkeys = {}
@@ -409,11 +413,12 @@
 	tk_call('font', 'actual', font, "-displayof", window, "-#{option}")
       end
     else
-      l = tk_split_list(if window
-			  tk_call('font', 'actual', font, "-displayof", window)
-			else
-			  tk_call('font', 'actual', font)
-			end)
+      l = tk_split_simplelist(if window
+			 	 tk_call('font', 'actual', font, 
+					             "-displayof", window)
+			      else
+			  	 tk_call('font', 'actual', font)
+			      end)
       r = []
       while key=l.shift
 	if key == '-compound'
@@ -455,7 +460,7 @@
     elsif option
       tk_call('font', 'configure', font, "-#{option}")
     else
-      l = tk_split_list(tk_call('font', 'configure', font))
+      l = tk_split_simplelist(tk_call('font', 'configure', font))
       r = []
       while key=l.shift
 	if key == '-compound'


                                         永井 秀利 (九工大 知能情報)
                                             nagai@ai.kyutech.ac.jp

In This Thread