I am thinking about this problem at the moment. There are a lot of toolkits for ruby, but they all require different libraries and are a bit painful to get running. I am writing software for both OSX and linux. I have played with the following toolkits but I haven't made any decisions: - Gtk2 - Qt - wxRuby There are plenty of others but one thing that I would like to see/like to start is a wrapper that allows you to switch between all of the given frameworks using some sort of configuration. I think it would be good to describe the interface for a button, window, pane etc and then put wrapper classes around all of the toolkit implementation classes. I'm not sure how much interest this would generate in the community but I would be interested to find out. Cheers, Carl. On 4/5/06, Hidetoshi NAGAI <nagai / ai.kyutech.ac.jp> wrote: > From: "greg.rb" <ghalsey / yahoo.com> > Subject: is GUI a weak point? > Date: Wed, 5 Apr 2006 05:23:59 +0900 > Message-ID: <1144181980.267658.187480 / j33g2000cwa.googlegroups.com> > > Are there any good examples of getting tk widget data to ruby? > > > > Here is a simple example where I try to build an interface for the user > > to pick information which will then be sent to ruby to process. > > I couldn't understand what you want to ask. > Although the following is one of the samples rewriting yours, > it may not be able to answer your question. > =================================================================== > require 'tk' > > cash_locs=['NONE','NY1','NY2','NJ1','ETC.'] > > #-------------------------------- > # callback function > > def put_picked_value(s) > puts 'USER PICKED: ' + s > end > > #-------------------------------- > # GUI part > > Tk.root.title 'PICK LOCATION' > > TkButton.new(:text=>'Quit', > :command=>proc{exit}).pack(:side=>:bottom, :fill=>:x) > > f = TkFrame.new.pack(:fill=>:both, :expand=>true) > > list = TkListbox.new(f) > list.yscrollbar(TkScrollbar.new(f).pack(:side=>:right, :fill=>:y)) > list.pack(:side=>:left, :fill=>:both, :expand=>true) > > list.insert(:end, *cash_locs) > > list.bind('ButtonPress-1', > proc{|y| put_picked_value(list.get(list.nearest(y))) }, > '%y') > > Tk.mainloop() > =================================================================== > -- > Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp) > > -- Carl Woodward 0412218979 cjwoodward / gmail.com