Using [incr Widgets] in Ruby/Tk on OS X

I'm using Ruby 1.8.2 on Mac OS X 10.4.7. I discovered the Ruby distribution included a directory supporting [incr Widgets]. Some of them seemed pretty nifty, so I thought I'd try them out. My first try was to make an "instant" calendar with the Calendar widget. After a bit of fooling around I got a calendar up on my screen, but one of things I had to do to make it work bothers me.

The [incr Widgets] support files live in /usr/lib/ruby/1.8/tkextlib/iwidgets/. There is a file, /usr/lib/ruby/1.8/tkextlib/iwidgets.rb, that autoloads the iwidget classes. However, the iwidgets.rb is is coded with lines like

     autoload :Calendar, 'tkextlib/iwidgets/calendar'

which means iwidgets.rb has to be one directory level up (in /usr/lib/ruby/1.8/) to work. So I put a copy of iwidgets.rb in in /usr/lib/ruby/1.8/. With that hack, "require 'iwidgets'" works -- at least in the short term. But what will happen if Apple installs a newer version of Ruby as part of an OS X update? Is there a better way to fix this sort of problem?

Regards, Morton

Message-ID: <8F88D2EC-9D3E-49AE-AD6C-83267C6FB012@ameritech.net>

which means iwidgets.rb has to be one directory level up (in /usr/lib/
ruby/1.8/) to work. So I put a copy of iwidgets.rb in in /usr/lib/
ruby/1.8/. With that hack, "require 'iwidgets'" works -- at least in

Please use "require 'tkextlib/iwidgets'".
It will load "tkextlib/iwidgets.rb".

···

From: Morton Goldberg <m_goldberg@ameritech.net>
Subject: Using [incr Widgets] in Ruby/Tk on OS X
Date: Fri, 1 Sep 2006 11:43:09 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Thanks very much. That's what I needed to know. I don't know why I didn't think of it myself, but I didn't.

Regards, Morton

···

On Aug 31, 2006, at 11:01 PM, Hidetoshi NAGAI wrote:

From: Morton Goldberg <m_goldberg@ameritech.net>
Subject: Using [incr Widgets] in Ruby/Tk on OS X
Date: Fri, 1 Sep 2006 11:43:09 +0900
Message-ID: <8F88D2EC-9D3E-49AE-AD6C-83267C6FB012@ameritech.net>

which means iwidgets.rb has to be one directory level up (in /usr/lib/
ruby/1.8/) to work. So I put a copy of iwidgets.rb in in /usr/lib/
ruby/1.8/. With that hack, "require 'iwidgets'" works -- at least in

Please use "require 'tkextlib/iwidgets'".
It will load "tkextlib/iwidgets.rb".
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

i wanted to experiment that too, reading "SUPPORT_STATUS" gave me this
address :
IWidgets 4.0.2 http://sf.net/projects/incrTcl ==> iwidgets

being broken :
Invalid Project on sf...

···

Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> wrote:

Please use "require 'tkextlib/iwidgets'".
It will load "tkextlib/iwidgets.rb".

--
une bévue

the correct link seems to be :

http://incrtcl.sourceforge.net/

···

Une bévue <pere.noel@laponie.com.invalid> wrote:

IWidgets 4.0.2 http://sf.net/projects/incrTcl ==> iwidgets

--
une bévue

Message-ID: <1hkz8wz.p5aep51pfv1fpN%pere.noel@laponie.com.invalid>

> IWidgets 4.0.2 http://sf.net/projects/incrTcl ==> iwidgets
the correct link seems to be :
http://incrtcl.sourceforge.net/

Thank you for your report. I'll fix it later.

···

From: pere.noel@laponie.com.invalid (Une bévue)
Subject: Re: Using [incr Widgets] in Ruby/Tk on OS X
Date: Fri, 1 Sep 2006 15:35:26 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)