Theming Tk with tile

I have a dream: My own GUI applications looking like other
applications.

I went hunting around for theming for Tk, and bumped into Tile[1].

Tk being legendarily ugly, tile represents a great new hope that with
tile it could be elevated to being barely adequate.

I saw a reference that it was available in Ruby’s CVS from sometime in
2005, suggesting that there is support in the more recent versions of
Ruby.

I did some hunting, but I couldn’t find any references to how to get it
going.

Patching together some mailing list references, I think this is how I
could do it:

$ irb
require ‘tk’
require ‘tkextlib/tile’
Tk::Tile.Import_Tile_Widgets

The tile require fails since it’s not there. Presumably it’s not
included with ruby or ruby-tk with my distribution. That’s expected.

I see that there isn’t a gem for tile, or my guess at “gem install
tile” isn’t right.

I see that I could download tile [2] and built it from source, but
somehow I doubt this would solve my require problem.

I googled, and I searched the mailing lists, but I can’t find any
concrete examples of installing or using tile (outside of home
renovations), and I could use a bit of help…

I would also accept answers of “go use toolkit x instead”, but I
already intend to do that if I can’t get this going.

Also, is tile something I’d have to package with my program or have a
person install with my distributed software? How would that work?

[1] tile tk theming Tile: an improved themeing engine for Tk
[2] tile download
Download tile-0.7.8.tar.gz (TkTable / Tile / Vu)

From: “Sy Ali” [email protected]
Subject: Theming Tk with tile
Date: Sat, 10 Mar 2007 09:31:03 +0900
Message-ID:
[email protected]

I see that I could download tile [2] and built it from source, but
somehow I doubt this would solve my require problem.

If your Tcl/Tk can load the tile libraries which you installed,
Ruby/Tk will load them also.
Please try to run “/tkextlib/pkg_checker.rb”.
When its output includes the line
“Ready : tile.rb : require->{“tile”=>“0.7.8”}”,
your Ruby/Tk is ready for Tile extension.
If not, probably it will be a kind of search path problem.

If you feel a little difficult, please try to use the ActiveTcl
binary package.

On 3/11/07, Hidetoshi NAGAI [email protected] wrote:

Please try to run “/tkextlib/pkg_checker.rb”.
When its output includes the line
“Ready : tile.rb : require->{“tile”=>“0.7.8”}”,
your Ruby/Tk is ready for Tile extension.
If not, probably it will be a kind of search path problem.

I think you’re right. pkg_checker.rb gave me errors [1]

I downloaded activetcl, and did ln -s /opt/ActiveTcl-8.4/lib/tcl8.4/
/usr/lib/ so that my pkg_checker.rb could see its libraries. Now
pkg_checker runs, but gives me:

*LACK : tile.rb : require->{} FAIL->[[“tile”, :package]]

Which is normal since I didn’t install tile yet. =)

But, configuring tile gives me an error about “configuration
definitions” [2] … where do I find these?

Maybe something is wrong because I’m using a ruby-tk package from my
distribution (pclinuxos 2007-test3).

Isn’t there a gem for tile? =)

–+

[1] errors with pkg_checker:

$ /usr/lib/ruby/1.8/tkextlib/pkg_checker.rb
/usr/lib/ruby/1.8/tk.rb:1102:in `initialize’: Can’t find a usable
init.tcl in the following directories: (RuntimeError)
/usr/lib/tcl8.4 /usr/lib/tcl8.4 /lib/tcl8.4 /usr/library /library
/tcl8.4.13/library /usr/lib/tcl8.4

This probably means that Tcl wasn’t installed properly.
from /usr/lib/ruby/1.8/tk.rb:1102:in new' from /usr/lib/ruby/1.8/tk.rb:1102 from ./pkg_checker.rb:7:in require’
from ./pkg_checker.rb:7

–+

[2] configuring tile gives an error about “configuration definitions”

$ ./configure --with-tcl=/opt/ActiveTcl-8.4/lib/
checking for correct TEA configuration… ok (TEA 3.5)
checking for Tcl configuration… found
/opt/ActiveTcl-8.4/lib/tclConfig.sh
checking for existence of /opt/ActiveTcl-8.4/lib/tclConfig.sh…
loading
checking for Tk configuration… configure: WARNING: Can’t find Tk
configuration definitions

From: “Sy Ali” [email protected]
Subject: Re: Theming Tk with tile
Date: Mon, 12 Mar 2007 00:16:14 +0900
Message-ID:
[email protected]

I downloaded activetcl, and did ln -s /opt/ActiveTcl-8.4/lib/tcl8.4/
/usr/lib/ so that my pkg_checker.rb could see its libraries. Now

Then, possibly, your Ruby/Tk will expect that all Tcl/Tk extensions
exist on /usr/lib.
So,

pkg_checker runs, but gives me:

*LACK : tile.rb : require->{} FAIL->[[“tile”, :package]]

your Ruby/Tk cannot find Tile libraries.

Which is normal since I didn’t install tile yet. =)

But, configuring tile gives me an error about “configuration
definitions” [2] … where do I find these?

Please add “–with-tk=/opt/ActiveTcl-8.4/lib” option.

However, if you already have tcltklib.so for Tcl/Tk8.4, please try to
define “LD_LIBRARY_PATH=/opt/ActiveTcl-8.4/lib” env value.
Then, probably, your Ruby/Tk will use ActiveTcl libraries.