ActiveTcl 8.4.7 or 8.5.0 with One Click Ruby Installer

Hi,

Kenichi Tamura creates tcltklib.so for One Click Ruby Installer
with ActiveTcl 8.4.7.0 or 8.5.0.0b2. You can get it from

http://www.rubyist.net/~tamura/d/files/tcltklib-rb182vc7.zip

The install step is the followings.

1. Install One Click Ruby Installer 182-14_rc9

     It maybe better selection to uncheck "Tcl/Tk Win32 Libraries"
     in "Tcl/Tk GUI Libraries", because ActiveTcl libraries will be
     installed.

2. Install ActiveTcl 8.4.7.0 or 8.5.0.0b2

3. Install the new tcltklib.so.

     Extract tcltklib.so from downloaded tcltklib-rb182vc7.zip.
     When <root> denotes your install directory of One Click Ruby
     Installer, copy tcltklib.so to <root>\lib\site_ruby\1.8\

That is all.
Please try to run sample scripts of Ruby/Tk.

# Ruby Installer installs the launcher script of Ruby/Tk Widget Demo
# as "widget" (without extension). Probably, the file name is not
# convenient on Windows. Please rename it to "widget.rb".

···

--
                                  Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

I will add these instructions to the installer's FAQ page. Thanks!
Curt

Hidetoshi NAGAI wrote:

···

Hi,

Kenichi Tamura creates tcltklib.so for One Click Ruby Installer
with ActiveTcl 8.4.7.0 or 8.5.0.0b2. You can get it from

http://www.rubyist.net/~tamura/d/files/tcltklib-rb182vc7.zip

The install step is the followings.

1. Install One Click Ruby Installer 182-14_rc9

     It maybe better selection to uncheck "Tcl/Tk Win32 Libraries"
     in "Tcl/Tk GUI Libraries", because ActiveTcl libraries will be
     installed.

2. Install ActiveTcl 8.4.7.0 or 8.5.0.0b2

3. Install the new tcltklib.so.

     Extract tcltklib.so from downloaded tcltklib-rb182vc7.zip.
     When <root> denotes your install directory of One Click Ruby
     Installer, copy tcltklib.so to <root>\lib\site_ruby\1.8\

That is all.
Please try to run sample scripts of Ruby/Tk.

# Ruby Installer installs the launcher script of Ruby/Tk Widget Demo
# as "widget" (without extension). Probably, the file name is not
# convenient on Windows. Please rename it to "widget.rb".
--
                                  Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

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

See minor correction below.

Kenichi Tamura creates tcltklib.so for One Click Ruby Installer
with ActiveTcl 8.4.7.0 or 8.5.0.0b2. You can get it from

http://www.rubyist.net/~tamura/d/files/tcltklib-rb182vc7.zip

The install step is the followings.

1. Install One Click Ruby Installer 182-14_rc9

     It maybe better selection to uncheck "Tcl/Tk Win32 Libraries"
     in "Tcl/Tk GUI Libraries", because ActiveTcl libraries will be
     installed.

2. Install ActiveTcl 8.4.7.0 or 8.5.0.0b2

3. Install the new tcltklib.so.

     Extract tcltklib.so from downloaded tcltklib-rb182vc7.zip.
     When <root> denotes your install directory of One Click Ruby
     Installer, copy tcltklib.so to <root>\lib\site_ruby\1.8\

This should be <root>\lib\ruby\site_ruby\1.8\

···

That is all.
Please try to run sample scripts of Ruby/Tk.

# Ruby Installer installs the launcher script of Ruby/Tk Widget Demo
# as "widget" (without extension). Probably, the file name is not
# convenient on Windows. Please rename it to "widget.rb".
--
                                  Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

--
R. Mark Volkmann
Partner, Object Computing, Inc.

How can I request that a Tk widget have a fixed width?
For example, I have a TkOptionMenubutton that contains options of differing
lengths, but I don't want the width of the widget to change when different
options are selected.

···

--
R. Mark Volkmann
Partner, Object Computing, Inc.

Message-ID: <1100794408.419cca28b0533@mail.ociweb.com>

> When <root> denotes your install directory of One Click Ruby
> Installer, copy tcltklib.so to <root>\lib\site_ruby\1.8\

This should be <root>\lib\ruby\site_ruby\1.8\

You are right. Thank you for fixing my mistake.

···

From: "R. Mark Volkmann" <mark@ociweb.com>
Subject: Re: ActiveTcl 8.4.7 or 8.5.0 with One Click Ruby Installer
Date: Fri, 19 Nov 2004 01:37:02 +0900
--
                                  Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Hi,

···

From: "R. Mark Volkmann" <mark@ociweb.com>
Subject: Tk widget fixed width
Date: Tue, 23 Nov 2004 01:51:32 +0900
Message-ID: <1101140800.41a21340eaea5@mail.ociweb.com>

How can I request that a Tk widget have a fixed width?

Please give the width to the TkOptionMenubutton object.
Maybe you want to give the anchor option to it too.
For example,
-------------------------------------------------------------------
require 'tk'

mb = TkOptionMenubutton.new(TkVariable.new, 1, 123, 12345, 1234567, 123456789)
mb.width 5
mb.anchor :w
mb.pack
TkButton.new(:text=>'show', :command=>proc{p mb.value}).pack(:fill=>:x)
Tk.mainloop
-------------------------------------------------------------------

If you patch tk/menu.rb (see the tail of this mail; I committed it to CVS),
you can give the width option when creating the widget.
For example,
-------------------------------------------------------------------
require 'tk'

mb = TkOptionMenubutton.new(1, 123, 12345, 1234567, 123456789,
                            :width=>5, :anchor=>:w)
# Or,
# mb = TkOptionMenubutton.new(:values=>[1, 123, 12345, 1234567, 123456789],
# :width=>5, :anchor=>:w)
mb.pack
TkButton.new(:text=>'show', :command=>proc{p mb.value}).pack(:fill=>:x)
TkButton.new(:text=>'set 123', :command=>proc{mb.value = 123}).pack(:fill=>:x)
TkButton.new(:text=>'set 999', :command=>proc{mb.value = 999}).pack(:fill=>:x)
Tk.mainloop
-------------------------------------------------------------------
--
                                  Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

--- menu.rb.orig 2004-10-11 10:45:47.000000000 +0900
+++ menu.rb 2004-11-23 07:57:22.000000000 +0900
@@ -402,33 +402,56 @@
     end
   end

- def initialize(parent=nil, var=nil, firstval=nil, *vals)
- if parent.kind_of? Hash
- keys = _symbolkey2str(parent)
- parent = keys['parent']
- var = keys['variable'] if keys['variable']
- firstval, *vals = keys['values']
+ def initialize(*args)
+ # args :: [parent,] [var,] [value[, ...],] [keys]
+ # parent --> TkWindow or nil
+ # var --> TkVariable or nil
+ # keys --> Hash
+ # keys[:parent] or keys['parent'] --> parent
+ # keys[:variable] or keys['variable'] --> var
+ # keys[:values] or keys['values'] --> value, ...
+ # other Hash keys are menubutton options
+ keys = {}
+ keys = args.pop if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(keys)
+
+ parent = nil
+ if args[0].kind_of?(TkWindow) || args[0] == nil
+ parent = args.shift
+ else
+ parent = keys.delete('parent')
+ end
+
+ @variable = nil
+ if args[0].kind_of?(TkVariable) || args[0] == nil
+ @variable = args.shift
+ else
+ @variable = keys.delete('variable')
     end
- if parent.kind_of? TkVariable
- vals.unshift(firstval) if firstval
- firstval = var
- var = parent
- parent = nil
+ @variable = TkVariable.new unless @variable
+
+ (args = keys.delete('values') || ) if args.empty?
+ if args.empty?
+ args << @variable.value
+ else
+ @variable.value = args[0]
     end
- var = TkVariable.new unless var
- fail 'variable option must be TkVariable' unless var.kind_of? TkVariable
- @variable = var
- firstval = @variable.value unless firstval
- @variable.value = firstval
+
     install_win(if parent then parent.path end)
- @menu = OptionMenu.new(tk_call('tk_optionMenu', @path, @variable.id,
- firstval, *vals))
+ @menu = OptionMenu.new(tk_call('tk_optionMenu',
+ @path, @variable.id, *args))
+
+ configure(keys) if keys
   end

   def value
     @variable.value
   end

+ def value=(val)
+ @variable.value = val
+ end
+
   def activate(index)
     @menu.activate(index)
     self

Hidetoshi NAGAI ha scritto:

From: "R. Mark Volkmann" <mark@ociweb.com>
Subject: Re: ActiveTcl 8.4.7 or 8.5.0 with One Click Ruby Installer
Date: Fri, 19 Nov 2004 01:37:02 +0900
Message-ID: <1100794408.419cca28b0533@mail.ociweb.com>

    When <root> denotes your install directory of One Click Ruby
    Installer, copy tcltklib.so to <root>\lib\site_ruby\1.8\

This should be <root>\lib\ruby\site_ruby\1.8\

You are right. Thank you for fixing my mistake.

I just noticed that ActiveTcl8.4.7's iconv.dll seem to be incompatible with ruby-gnome2 0.11.
In case someone has an error like:

"Can't find DLL entry point libiconv_set_relocation_prefix for dynamic library iconv.dll " (I'm guessing since I read the msg in italian :slight_smile:

just switching the order of $tcldir and $gtkdir in the path seem to fix it (i.e. let ruby search gtk's iconv.dll before tcl's). ActiveTcl still seem to work fine.

Just in case someone could need this.

Hi,

···

From: gabriele renzi <rff_rff@remove-yahoo.it>
Subject: Re: ActiveTcl 8.4.7 or 8.5.0 with One Click Ruby Installer
Date: Sat, 20 Nov 2004 20:48:24 +0900
Message-ID: <x8Gnd.43243$Es2.932368@twister2.libero.it>

I just noticed that ActiveTcl8.4.7's iconv.dll seem to be incompatible
with ruby-gnome2 0.11.

(snip)

Hmm... This mail replies my mail.
But the trouble described in it will not be in my domain.
Please ask the maintainer of One Click Ruby Installer. :slight_smile:
--
                                  Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)