From: "G B-)" Date: 2006-02-18T04:48:28+09:00 Subject: Re: Ruby TK GUI question Harry Truax wrote: > Hi, > > I am writing a Ruby GUI TK application ... > > Any references to Ruby TK function names would be greatly appreciated. The Tcl/Tk manual is easy to find with google, for example: http://www.tcl.tk/man/tcl8.4/TkCmd/contents.htm 0. Ensure this works: require 'tk' 1. To convert the Tk widget commands to Ruby class names, prepend "Tk" and capitalise, for example the Tcl/Tk "entry" command becomes the Ruby class "TkEntry" 2. To apply an option, just use the tk option name without the leading '-', for example "-relief" is just "relief". 3. Options can be set in two different ways, either: a. provide a hash of option value pairs, the option name is a string: example { 'relief' => 'ridge', 'width'=>3 } and hand this hash over as a parameter (you don't necessarily need { } in a method call), or b. provide a block, e.g. to new entry = TkEntry.new(root) do justify 'center' width 3 borderwidth 3 relief 'ridge' end # notice the option names are not quoted here, but look like method names The other thing you might want to do is take a look at this Ruby/Tk tutorial http://members.chello.nl/~k.vangelder/ruby/learntk/ I haven't read this, but it looked interesting: http://www.syngress.com/book_catalog/183_Ruby/sample.htm HTH GB-) > > ------=_NextPart_000_001F_01C633A1.09678BD0--