Home
Username:
Password:
Programming With Ruby Tutorials

Graphical Interfaces / Other Ruby Graphical Toolkits




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

In this video I'm going to look at a couple of other Gooey libraries for Ruby. The first one is Ruby TK. Now, TK actually has been around for quite some time. It's come over from the X Windows world of Unix Linux and the main language that used TK was something called TCL, which was a scripting-type language. But this library has the proper bindings to use TK and it's pretty, pretty straightforward to use it. I've had some problems actually installing it on my Mac and haven't been able to actually get it going at this point. I'm going to include the URLs for this tutorial website available here and then one other place where you can actually download it. It's a pretty straightforward installation. You should have TK already installed on like a Linux-type system. On Windows you're probably going to have to go and download it and search around for that. On the Mac, I think if you have an original install it should be ok, but you'll have to check that out. Now, O'Reilly did a series on using Ruby TK and I'll include the URL for the start of this. I just wanted to show you the code here to get you a flavor of what it looks like. Again, we start with our typical require. We create a root frame for the application, which is essentially the window, the main window. We create a button with a call-back type procedure or method on that button so when you click on the button it prints out this congratulations in creating this. And some stuff that has to do with how that Gooey actually goes together with the buttons and the window. And finally, you start the main loop. So it's pretty similar to how those other Gooey libraries we looked at work, although I've had these installation issues. So you may or may not run into that. Now, the one other library that I wanted to just briefly mention is for the QT library, which is what KDE, the KDE development or KDE Gooey environment on Linux systems is developed in. But the QT frameworks are available in Windows and Mac, so you can use these bindings to develop Ruby applications that use that QT framework. And they'd pretty much be cross-platform. And it's similar to how the Ruby Coco framework, binding framework worked in that you're using that framework, use Ruby to call into that framework and draw the various widgets on the screen. There is a book available from the Pragmatic Programmers called Rapid Gooey Development with QT Ruby. I haven't actually looked at it but I'm always been a big fan of the Pragmatic Programmers book series. They're high-quality books that get you up to speed pretty quickly. So I would recommend if it's something serious you want to look at, that you go and take a look at that book. A quick hello world example. We always got to have our gratuitous hello world example here. Again, pretty straightforward starting off with our require. We get start a new application. We go ahead and add a button to it. We allow it to resize with whatever the sizing given here and we establish the main widget and then we call it. And execute it. So it's pretty much the same kind of ordering as all those other libraries that just, that some of the methods that we're calling or have a different name but pretty much the same kind of flow. And again, I will include the URLs for these websites so that you can go there and explore these yourself. Now, in these last couple of video series, we've looked at several different Gooey development environments and it's, if it's something you're considering doing, you're going to have to balance out do you want your application to be cross-platform? Do you want it to be widely distributed? Do you need specific functionality in whatever framework the library might actually give you? You're going to have to balance those things in deciding which Gooey framework that you're going to use and look at which one will get you up to speed the quickest on whatever system that you're trying to target also. So hopefully that gives you an overview of Gooey environments, libraries, frameworks available to develop with Ruby.

Tutorial Information

Course: Programming With Ruby
Author: Al Anderson
SKU: 33788
ISBN: 1-934743-01-1
Release Date: 2007-08-21
Duration: 8.5 hrs / 113 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available