From: Harry Truax Date: 2006-03-10T00:47:25+09:00 Subject: Re: Looking for good reads on Ruby TK GUI programming Karl, I know what you mean. I have found several Perl/TK examples, but found it Difficult in discovering the translation to Ruby/TK. I guess I will go and Buy a good TK book on GUI programming and start there. Harry -----Original Message----- From: Karl von Laudermann [mailto:doodpants@mailinator.com] Sent: Thursday, March 09, 2006 10:39 AM To: ruby-talk ML Subject: Re: Looking for good reads on Ruby TK GUI programming Harry Truax wrote: > Hello, > > Could anyone suggest any good examples, articles, books, etc. for Ruby > TK GUI programming with particular emphasis on multi-screen/window GUI > applications? No. And it's frustrating. The only Ruby/Tk tutorials I've been able to find, including the Ruby/Tk chapter of the Pickaxe, just provide a few simple examples, then tell you to go find some other Tk API documentation and translate it in your head into Ruby/Tk. It took me maybe two hours of Googling just to figure out how to programmatically select some text in a TkText widget. (The answer is that TkText has a concept called "tags", and you can apply any arbitrary tag to any range of text in the widget, and to select some text you apply a predefined tag called "sel" to the desired range using the tag_add() method. Because a set_selection() method would have been too straightforward and useful.) It would be really nice if someone would write a definitive book on developing GUI apps with Ruby/Tk. What I'm envisioning is a complete guide on how to develop GUI apps using Tk, covering all necessary concepts such as how to use most widgets (buttons, checkboxes, text controls, menus, etc.), how to do modal and non-modal dialogs, how to manage multiple windows, event handling, key shortcuts, etc. And it would use Ruby and Ruby/Tk exclusively as the language and API for its code samples. And of course include a complete Ruby/Tk API reference as it's second half. And if, say, the Pragmatic Programmers were to write such a book, that would rock.