On 5/18/05, Dave Baldwin <dave.baldwin / 3dlabs.com> wrote:
> 
> On 18 May 2005, at 02:31, Mark Hubbart wrote:
> 
> > Hi --
> >
> > On 5/17/05, Philipp Kern <trash / philkern.de> wrote:
> >
> >> Mark Hubbart wrote:
> >>
> >>> On 5/17/05, Tom Nakamura <imifumei / imap.cc> wrote:
> >>>
> >>>> Can anyone do a quick test to see if "require 'tk'" work by
> >>>> default on
> >>>> Tiger?
> >>>>
> >>> Yes! Imagine my surprise :)
> >>>
> >>
> >> And it looks really nice (apart from the window background colour,
> >> but
> >> I'm sure that one could fix this) as the OS X Tk uses native controls
> >> where possible. I think I had the same surprised look on my eyes like
> >> you, Mark. (=
> >>
> >
> > Yeah :) I guess they used the TclTkAqua framework. It sure seems to be
> > the same thing, anyway, and I don't think there was any other
> > distribution that used native widgets. Also, the tcl/tk extension
> > compiles right out of the box, so that's great for the project I'm
> > working on. Now I just have to start learning to use it; I never
> > bothered before.
> >
> > cheers,
> > Mark
> >
> >
> I tried this simple program from Pickaxe
> require 'tk'
> TkLabel.new { text 'Hello, World!'; pack }
> Tk.mainloop
> 
> and got:
> 
> dyld: NSLinkModule() error
> dyld: Library not loaded: /usr/X11R6/lib/libX11.6.dylib
>    Referenced from: /usr/lib/ruby/1.8/powerpc-darwin8.0/tcltklib.bundle
>    Reason: image not found
> Trace/BPT trap
> 
> so it looks like it relies on X11 being installed.  I did a standard
> Tiger install with xcode but not x11.

It works fine here, with X11. If you are doing any unix stuff, you
really should have X11 installed anyway. The only thing that bothers
me is that this means a Ruby/Tk app will only run on a computer that
has the X11 lib.

Since Tk uses Aqua, not X11, as a display (you get an icon in the dock
and everything here), I'm guessing that it links to X11 for some other
dependencies. But it *is* a bit annoying... I wonder if that
dependency could be eliminated?

cheers,
Mark