From: Hidetoshi NAGAI Date: 2005-01-11T00:49:46+09:00 Subject: Re: Interactive Fox GUI Builder and Code Generator Hi, From: tony summerfelt Subject: Interactive Fox GUI Builder and Code Generator Date: Mon, 10 Jan 2005 03:44:52 +0900 Message-ID: > >Ruby/Tk can load Tcl/Tk script files. > >So, one of the easiest way is to extract the GUI part of your script > >and load it into Ruby/Tk. > > i did not know that...has anybody done this and liked the results? > for me that's a good short term solution. However, you must decide how to get information from your GUI. The following is a sample of using Tcl/Tk's 'rolodex' demo. Please attend that Ruby/Tk creates widget objects automatically when refers the widgets. # Of course, you can create a widget object for a widget # (that already exists) by your method call. # e.g. TkEntry.new(:widgetname=>'.frame.entry1', :without_creating=>true) ---------------------------------------------------------- $ /usr/local/bin/irb -r tk irb(main):001:0> Tk.load_tclscript('rolodex') => "" irb(main):002:0> Thread.new{Tk.mainloop} => # irb(main):003:0> TkWinfo.children(Tk.root) => [#, #, #] irb(main):004:0> TkWinfo.children(Tk.root).size => 3 irb(main):005:0> f = TkWinfo.children(Tk.root)[0] => # irb(main):006:0> TkWinfo.children(f) => [#, #, #, #, #, #, #, #, #, #, #, #, #, #] irb(main):007:0> TkWinfo.children(f)[1].insert(:end, 'asdf') => # irb(main):008:0> e = TkWinfo.children(f)[1] => # irb(main):009:0> e.insert(:end, 'qwer') => # irb(main):010:0> e.value => "asdfqwer" irb(main):011:0> ---------------------------------------------------------- -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)