From: "Harry Truax" <htruax / stf.com>
Subject: TK padx question
Date: Fri, 27 Jun 2008 02:45:22 +0900
Message-ID: <002601c8d7b4$b5db6a80$1e00000a / corp.stf.com>
> I was wondering if anyone knows how to specify a list of two values for
> :padx - I have been using ":padx=>5" for example, in positioning a button
> widget inside a frame that holds four buttons. I have been reading online
> that you can specify a list of two values when you want to pad on the left
> and right using different values.

There are some examples under "<ruby-src>/ext/tk/sample" directory.
For example, "demos-en/image3.rb" uses ":padx=>[0, '2m']".

Fundamentally, when Tcl/Tk requires a list of values, 
please give an array on Ruby/Tk. 
If the rule doesn't work, it must be a bug.

As a similar rule, when Tcl/Tk requires a list 
"-option val -option val ...", please give a hash 
{option=>val, option=>val, ...} on Ruby/Tk.

"font" option may be a good example.
-------------------------------------------------------------------
Tcl/Tk:  button .b -font {Times 14 bold underline}
  v
Ruby/Tk: TkButton.new(:font=>['Times', 14, 'bold', 'underline'])
         TkButton.new(:font=>%w(Times 14 bold underline))
         TkButton.new(:font=>['Times', 14, :bold, :underline])
            # A symbol is converted to a string.
         TkButton.new(:font=>"Times 14 bold underline")
            # Tcl/Tk's list is a string, So this is also available.

Tcl/Tk:  button .b -font {-family Times -size 14 -weight bold -underline true}
  v
Ruby/Tk: TkButton.new(:font=>{:family=>'Times', :size=>14,
                              :weight=>'bold', :underline=>true])
         TkButton.new(:font=>{'family'=>'Times', 'size'=>14, 
                              'weight'=>'bold', 'underline'=>true])
            # Both of a symbol and a string are available for keys.
         TkButton.new(:font=>"-family Times -size 14 -weight bold -underline true")
            # Of course, this is OK.
-------------------------------------------------------------------
-- 
Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)