From: Albert Schlef on
I have an item in my Treeview that I want to highlight. I have this
code:

require 'tk'

tree = Tk::Tile::Treeview.new.pack

tree.insert('', 'end', :text => 'blah blah', :tags => ['important'])

tree.tag_configure('configure', 'important', :background => 'yellow')

Tk.mainloop

But the item isn't shown with its background painted in yellow.

I took that code from:

http://www.tkdocs.com/tutorial/tree.html#appearance

That article mentions this bug in Ruby/Tk.

Is it possible to add some code in Ruby to fix the bug?

(I'm using Tk 8.4, Tile, and Ruby 1.8.7p174, Ubuntu.)
--
Posted via http://www.ruby-forum.com/.

From: Hidetoshi NAGAI on
From: Albert Schlef <albertschlef(a)gmail.com>
Subject: Ruby/Tk: How to colorize a Treeview?
Date: Sun, 21 Mar 2010 13:48:11 +0900
Message-ID: <0206b1e13c95db7c2dc3057fc0685444(a)ruby-forum.com>
> tree.tag_configure('configure', 'important', :background => 'yellow')
(snip)
> I took that code from:
>
> http://www.tkdocs.com/tutorial/tree.html#appearance
>
> That article mentions this bug in Ruby/Tk.

Please try "tree.tag_configure('important', :background => 'yellow')".
I think the bug is already fixed (at least, on the latest Ruby/Tk).
--
Hidetoshi NAGAI (nagai(a)ai.kyutech.ac.jp)

From: Albert Schlef on
Hidetoshi NAGAI wrote:
> From: Albert Schlef <albertschlef(a)gmail.com>
> Subject: Ruby/Tk: How to colorize a Treeview?
> Date: Sun, 21 Mar 2010 13:48:11 +0900
> Message-ID: <0206b1e13c95db7c2dc3057fc0685444(a)ruby-forum.com>
>> tree.tag_configure('configure', 'important', :background => 'yellow')
> (snip)
>> I took that code from:
>>
>> http://www.tkdocs.com/tutorial/tree.html#appearance
>>
>> That article mentions this bug in Ruby/Tk.
>
> Please try "tree.tag_configure('important', :background => 'yellow')".
> I think the bug is already fixed (at least, on the latest Ruby/Tk).

Thanks. Upgrading Ruby/Tk isn't a viable solution for me because I can't
force my users to upgrade theirs.

Well, this isn't critical. I can live without this feature.

(BTW, I'm using the most recent Ruby 1.8 Ubuntu provides, which is
1.8.7.174, and the bug is there.)

Anyway, thanks, Hidetoshi. I appreciate it that you're here to answer
our questions.
--
Posted via http://www.ruby-forum.com/.