[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby/TK on Mac OS X Tiger?

Tom Nakamura

5/17/2005 8:08:00 AM

Can anyone do a quick test to see if "require 'tk'" work by default on
Tiger?
Tom


9 Answers

Mark Hubbart

5/17/2005 8:17:00 AM

0

Hi,

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 :)

cheers,
Mark


Philipp Kern

5/17/2005 9:53:00 PM

0

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. (=

Kind regards,
Philipp Kern

Mark Hubbart

5/18/2005 1:31:00 AM

0

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


Dave Baldwin

5/18/2005 7:37:00 AM

0


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.

Dave.




Mark Hubbart

5/18/2005 4:03:00 PM

0

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


Mark Hubbart

5/18/2005 4:11:00 PM

0

On 5/18/05, Mark Hubbart <discordantus@gmail.com> wrote:
> 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?

I forgot to specify that the requirement is in the *Ruby* Tk
extension, not in the Tk framework itself. Tk apps run fine without
X11, RubyTk apps don't.

cheers,
Mark


Hidetoshi NAGAI

5/19/2005 3:55:00 AM

0

Mark Hubbart

5/19/2005 7:43:00 AM

0

On 5/18/05, Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> wrote:
> From: Mark Hubbart <discordantus@gmail.com>
> Subject: Re: Ruby/TK on Mac OS X Tiger?
> Date: Thu, 19 May 2005 01:10:50 +0900
> Message-ID: <de63abca050518091045ad43b6@mail.gmail.com>
> > I forgot to specify that the requirement is in the *Ruby* Tk
> > extension, not in the Tk framework itself. Tk apps run fine without
> > X11, RubyTk apps don't.
>
> Hmmm...
> I think, when do configure with "--enable-mac-tcltk-framework"
> option, Ruby/Tk (tcltklib) doesn't need to link the X11 library.
> Am I wrong?
> Could anyone try to compile with "--enable-mac-tcltk-framework" ?

I'll try it out. I suspect Apple used it when compiling, though, since
they linked it against the framework.

configure --prefix=/foo/local --enable-mac-tcltk-framework --enable-pthread

...

configured, compiled, installed, moved the X11 library out of the way.
it fails while trying to load libx11.

Tried removing X11 and compiling the tcltklib extension. It wouldn't compile.

Here's the extconf output from a successful configuration:

mark@eMac% ruby extconf.rb
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for dlopen() in -ldl... yes
checking for log() in -lm... no
checking for tcl.h... yes
checking for tk.h... yes
checking for XOpenDisplay() in -lX11... yes
checking for Tcl_FindExecutable() in -ltcl... yes
checking for Tk_Init() in -ltk... yes
creating Makefile

Also, since my recent Tiger (OSX 10.4) upgrade, the average c file in
the ruby source gives a good 20-30 warnings about pointers differing
in signedness. Yay, megabytes of text in my scrollback buffer. :)

HTH,
Mark


Hidetoshi NAGAI

5/19/2005 10:00:00 AM

0