ActiveTcl 8.4.7 or 8.5.0 with One Click Ruby Installer

H

Hidetoshi NAGAI

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".
 
H

Hidetoshi NAGAI

From: "R. Mark Volkmann" <[email protected]>
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: said:
This should be <root>\lib\ruby\site_ruby\1.8\

You are right. Thank you for fixing my mistake.
 
G

gabriele renzi

Hidetoshi NAGAI ha scritto:
From: "R. Mark Volkmann" <[email protected]>
Subject: Re: ActiveTcl 8.4.7 or 8.5.0 with One Click Ruby Installer
Date: Fri, 19 Nov 2004 01:37:02 +0900



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

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.
 
H

Hidetoshi NAGAI

Hi,

From: gabriele renzi <[email protected]>
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: said:
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. :)
 
R

R. Mark Volkmann

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.
 
H

Hidetoshi NAGAI

Hi,

From: "R. Mark Volkmann" <[email protected]>
Subject: Tk widget fixed width
Date: Tue, 23 Nov 2004 01:51:32 +0900
Message-ID: said:
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 ([email protected])

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top