[#3567] Nil is a subclass of Object? — shugo@... (maeda shugo)

前田です。

26 messages 1997/08/02
[#3570] Re: Nil is a subclass of Object? — matz@... (Yukihiro Matsumoto) 1997/08/03

まつもと ゆきひろです

[#3572] Re: Nil is a subclass of Object? — keiju@... (石塚圭樹 ) 1997/08/03

けいじゅ@日本ラショナルです.

[#3573] Re: Nil is a subclass of Object? — matz@... (Yukihiro Matsumoto) 1997/08/03

まつもと ゆきひろです

[#3715] may i make a ruby.rpm? — Shoichi OZAWA <ozawa@...>

こんにちは 小澤@日立 です。

15 messages 1997/08/20

[#3736] module for GNU Readline Library — shugo@... (前田 修吾 / maeda shugo)

前田です。

12 messages 1997/08/20

[#3833] [Bug] Regexp.quote — shugo@... (前田 修吾 / maeda shugo)

前田です。

25 messages 1997/08/26
[#3836] BEGIN and END — Masaki Suketa <suke@...> 1997/08/26

助田です。

[#3837] Re: BEGIN and END — matz@... (Yukihiro Matsumoto) 1997/08/27

まつもと ゆきひろです

[#3842] Re: BEGIN and END — keiju@... (石塚圭樹 ) 1997/08/27

けいじゅ@日本ラショナルです.

[#3839] Re: SyslogSendmail class — takagi@... (TAKAGI Hiromitsu)

> そうですね.本当はこーゆーのが ruby-list の本来の形ですね.

18 messages 1997/08/27
[#3840] Re: SyslogSendmail class — matz@... (Yukihiro Matsumoto) 1997/08/27

まつもと ゆきひろです

[#3852] Re: SyslogSendmail class — keiju@... (石塚圭樹 ) 1997/08/27

けいじゅ@日本ラショナルソフトウェアです.

[#3909] Object#id <=> Fixnum#id2object ? (Re: SyslogSendmail class) — shugo@... (前田 修吾 / maeda shugo) 1997/08/28

前田です。

[#3869] Re: SyslogSendmail class — takagi@... (TAKAGI Hiromitsu)

> Moduleのところに書いてあるんですねえ.こういうノウハウを記述

15 messages 1997/08/27
[#3870] Re: SyslogSendmail class — matz@... (Yukihiro Matsumoto) 1997/08/27

まつもと ゆきひろです

[#3906] document for beginner — toyofuku@...

豊福@パパイヤです。

21 messages 1997/08/28
[#3917] Re: document for beginner — Kikutani Makoto <kikutani@...> 1997/08/29

きくたにです。

[#3925] Re: document for beginner — Masaki Suketa <suke@...> 1997/08/29

助田です

[#3926] Curses (Re: document for beginner) — Kikutani Makoto <kikutani@...> 1997/08/29

Fri, Aug 29, 1997 at 12:54:15PM +0900 において

[#3933] Re: ruby constants — toyofuku@...

豊福@パパイヤです。

16 messages 1997/08/29
[#3934] Re: ruby constants — matz@... (Yukihiro Matsumoto) 1997/08/29

まつもと ゆきひろです

[#3939] Re: ruby constants — WATANABE Hirofumi <watanabe@...> 1997/08/29

わたなべです.

[ruby-list:3556] Re: text tag (ruby/tk)

From: matz@... (Yukihiro Matsumoto)
Date: 1997-08-01 04:17:35 UTC
List: ruby-list #3556
まつもと ゆきひろです

In message "[ruby-list:3544] text tag (ruby/tk)"
    on 97/07/31, Noritsugu Nakamura <nnakamur@mxq.meshnet.or.jp> writes:
|中村です。
|
|また、分からないことが出てきてしまいました。
|ruby/tk の Text Widget での tag の使用法に
|ついてです。
|
|例えば、以下と同じプログラムを書きたいのですが、
|どう書けばよいのでしょうか?
|
|#!/usr/local/bin/wish4.2
|
|text .t -width 30 -height 10
|pack .t
|
|.t tag configure big -font -*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*
|
|.t insert end "Text Tag\n" big
|.t insert end "normal size\n"

いやあ,バグってました.添付のパッチを当てた後では以下のよう
になります.

#!/usr/local/bin/ruby

require "tk"

text = TkText.new {
  width 30
  height 10
  pack
}
big = TkTextTag.new(text,"font" => "-*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*")

text.insert "end", "Text Tag\n", big
text.insert "end", "normal size\n"

Tk.mainloop

--
--- lib/tktext.rb~	Sun Jul 27 00:27:59 1997
+++ lib/tktext.rb	Fri Aug  1 13:06:24 1997
@@ -26,6 +26,5 @@
   end
-  def _addtag(cmd)
-    @cmdtbl.push id
+  def _addtag(name, obj)
+    @tags[name] = obj
   end
-  private :_addcmd, :_addtag
   def tag_names
@@ -88,3 +87,3 @@
   $tk_text_tag = 'tag0000'
-  def initialize(parent)
+  def initialize(parent, keys=nil)
     if not parent.kind_of?(TkText)
@@ -93,5 +92,5 @@
     @t = parent
-    @path = parent.path
-    @id = $tk_text_tag
+    @path = @id = $tk_text_tag
     $tk_text_tag = $tk_text_tag.succ
+    tk_call @t.path, "tag", "configure", @id, *hash_kv(keys)
     @t._addtag id, self
@@ -103,7 +102,7 @@
   def add(*index)
-    tk_call path, 'tag', 'add', @id, *index
+    tk_call @t.path, 'tag', 'add', @id, *index
   end
 
-  def configure(slot, value)
-    tk_call path, 'tag', 'configure', id, "-#{slot}", value
+  def configure(keys)
+    tk_call @t.path, 'tag', 'configure', @id, *hash_kv(keys)
   end
@@ -112,3 +111,3 @@
     id = install_cmd(cmd)
-    tk_call path, 'tag', 'bind', tag, "<#{seq}>", id
+    tk_call @t, 'tag', 'bind', tag, "<#{seq}>", id
     @t._addcmd cmd
@@ -117,3 +116,3 @@
   def lower(below=None)
-    tk_call path, 'tag', 'lower', below
+    tk_call @t.path, 'tag', 'lower', below
   end
@@ -121,3 +120,3 @@
   def destroy
-    tk_call path, 'tag', 'delete', @id
+    tk_call @t.path, 'tag', 'delete', @id
   end
@@ -132,6 +131,5 @@
     @t = parent
-    @path = parent.path
-    @id = $tk_text_mark
+    @path = @id = $tk_text_mark
     $tk_text_mark = $tk_text_mark.succ
-    tk_call @t, 'set', @id, index
+    tk_call @t.path, 'set', @id, index
     @t._addtag id, self
@@ -143,3 +141,3 @@
   def set(where)
-    tk_call path, 'mark', 'unset', @id, where
+    tk_call @t.path, 'mark', 'unset', @id, where
   end
@@ -147,3 +145,3 @@
   def unset
-    tk_call path, 'mark', 'unset', @id
+    tk_call @t.path, 'mark', 'unset', @id
   end
@@ -158,5 +156,4 @@
     @t = parent
-    @path = parent.path
-    @index = index
-    tk_call @path, 'window', 'create', index, *args
+    @path = @index = index
+    tk_call @t.path, 'window', 'create', index, *args
   end
@@ -164,3 +161,3 @@
   def configure(slot, value)
-    tk_call path, 'window', 'configure', @index, "-#{slot}", value
+    tk_call @t.path, 'window', 'configure', @index, "-#{slot}", value
   end

In This Thread