Archive for the ‘FXRuby’ Category

Build GUIs Interactively with foxGUIb

foxGUIb is a tool developed by Meinrad Recheis (aka Henon) that you can use to interactively build user interfaces for FXRuby. The project’s home page includes some screen shots and general information about its use, and Mike Parr has contributed a user guide to help you get started with its use.

Henon has just announced that he’s making plans for the 1.0 release of foxGUIb, and he’s asking you for your requests in terms of desired features and changes for the software. If you have suggestions for him, or would like to pitch in and help out with that project, be sure to follow up with him!

It’s Here!

This was waiting for me in the mail when I went home at lunch today.

Pragmatic Programmers Podcast Interview

The book, FXRuby: Create Lean and Mean GUIs with Ruby, is finally done! Thanks very much to all of the reviewers and Beta book readers who gave me such great and helpful feedback over the last few months. Print copies of the book should begin shipping soon. I’m expecting to receive my own copy in the mail any day now.

Last week my editor, Susannah Pfalzer, interviewed me about the book for the Pragmatic Programmers’ podcast series, and that podcast has just dropped. If you’ve been holding off on buying the book, some of the things that Susannah and I talk about in the podcast may help you to understand a bit better about what the book covers.

One-step installation for FXRuby on Mac OS X

In previous posts over the last few months I’ve written about the efforts to get the ports of FOX and FXRuby working in MacPorts for OS X “Leopard.” Now that that issue is (mostly) settled, the next thing I wanted to do was work out the steps required to provide a binary gem of FXRuby for OS X that didn’t depend on MacPorts. I’m pleased to report that as of today, with the release of version 1.6.14 of FXRuby, that binary gem is now available.

If you’re running OS X and using the built-in version of Ruby that comes with that operating system, you can install FXRuby by typing:

$ sudo gem install fxruby

Once the installation is complete, you can verify that it’s working properly by firing up irb and trying to require the library:

$ irb
>> require 'rubygems'
=> false
>> require 'fox16'
=> true
>> Fox.fxrubyversion
"1.6.14"

Hopefully, this will make it a lot easier for Mac users to get up and running with FXRuby. If you run into problems installing or using the gem, please report them on the FXRuby mailing list.

fxtwitter: a new Twitter client

Brian Wisti has just released fxtwitter, a client for Twitter that’s written in Ruby and uses FXRuby for the user interface.

Building FXRuby on Leopard with MacPorts (Update)

I previously wrote about the difficulties some people (including myself) were having with building FXRuby on Mac OS X (Leopard). I am pleased to report that as of the most recent update to MacPorts, the Ruby port has been upgraded to 1.8.6-p111 (previous version was 1.8.6-p110), and this seems to have fixed the problem.

If you’ve been having trouble building FXRuby “out of the box” on Mac OS X, first make sure you have the latest MacPorts and that you’ve upgraded to ruby-1.8.6-p111:

$ sudo port -d sync $ sudo port upgrade ruby
Once that’s done, you should be able to either install FXRuby from its port, e.g.
$ sudo port install rb-fxruby
or from the source gem, e.g.
$ sudo gem install fxruby
If you’re still having trouble after this update, please let me know!

Building FXRuby on Leopard with MacPorts

A number of people are having interesting problems trying to build FXRuby on Leopard (Mac OS 10.5) and so I’m trying to pin down exactly where the problems are. Last month, I wrote about some of the fundamental problems that you might run into building FXRuby “from scratch”, without the help of MacPorts. One problem has to do with an apparent bug in the latest release of the Xcode Developer Tools, and another has to do with the buggy X11 server that ships with Leopard. Putting those issues aside, I thought that the MacPorts build was working fine.

Turns out it wasn’t fine after all. Sorry about that.

In an attempt to get to the bottom of things, I began by completely wiping out the /opt directory on my iMac (which is running Mac OS 10.5.1). Next, I reinstalled the MacPorts 1.6.0 base package. Finally, I fired off an install of the rb-fxruby port:

$ sudo port -v install rb-fxruby
Then I went to bed, because I knew that this fresh install of MacPorts was going to need to download and build a bunch of dependencies before it ever got anywhere near FXRuby.

When I checked on the progress the next morning, I saw that, sure enough, the build failed for FXRuby. Some of the last gasps of that attempted build included lines like:

i686-apple-darwin9-gcc-4.0.1: corewrap.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: dcwrap.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: dialogswrap.o: No such file or directory
which suggests that those object files were either never compiled, or that they were compiled and subsequently blown away before the linker could get to them. Turns out it was the former case. When I scrolled a little further up in the build log, I could see lines like:
I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.1.0 -I/opt/local/var/macports/build/optlocalvarmacportssourcesrsync.macports.orgreleaseportsrubyrb-fxruby/work/FXRuby-1.6.13/ext/fox16 -DHAVESYSTIMEH -DHAVESIGNALH -I/opt/local/include/fxscintilla -I/opt/local/include/fox-1.6 -I/opt/local/include -fno-common -O2 -fno-common -pipe -fno-common -O0 -Iinclude -DWITHFXSCINTILLA -DHAVEFOX16 -c corewrap.cpp make: I.: Command not found make: [corewrap.o] Error 127 (ignored)
If you’re not used to scouring build logs looking for strange errors, it may not be obvious what’s wrong: there ought to be a compiler command (such as gcc or g++) at the beginning of the line that starts out “I. -I. -I/opt/local/...“.

What’s even more interesting to me is that when I typed (again):

$ sudo port -v install rb-fxruby
This time, the build went through fine. Those lines that previously didn’t show a compiler command were now invoking the C++ compiler (g++), and so those object files (like core_wrap.o) that were missing in action the last time around got created after all, and everyone lived happily ever after.

So the next part of the investigation is for me to figure out what was broken during the first pass, and why the C++ compiler wasn’t being picked up properly by FXRuby’s extconf.rb script. More to come…

Update: Problem seems to be resolved as of the latest update to Ruby in MacPorts.

Second Beta Release for FXRuby Book

An updated version of the beta book has been released today. The most visible change for this release is the inclusion of the final three chapters of the book, which were still being edited and revised at the time of the initial release. The new chapters cover layout managers, menus and toolbars, and dialog boxes. Thanks to comments and suggestions from beta book readers and other reviewers, I’ve had the opportunity to make a number of fixes and improvements to the previously released chapters as well.

Many of the changes involved the extended “Picture Book” tutorial. For example, the layout algorithm that was described in section 4.4 didn’t work well in some circumstances (e.g. when the first photo in the album was taller than it was wide, or when the main window was resized so that it was narrower than the width of the first photo). As a result of these and other issues, that section has been revised a bit. Another significant problem that several readers noted had to do with the initialize() method for the AlbumView class, which mysteriously changed between chapters 4 and 5 without any explanation. This problem has also been corrected.

Some readers have been having trouble running the examples due to misconfigured RubyGems installations. The code in the book is written under the assumption that if you’ve installed FXRuby using RubyGems, that you’ve also configured Ruby to automatically load up the runtime support for RubyGems, so that require statements will search through your installed gems repository when it’s trying to find libraries like FXRuby. As a result of the confusion over this issue, I’ve added a new sidebar that discusses RubyGems configuration issues.

Finally, there were a handful of other little changes, in some cases fixing typos, in other cases clarifying and improving the original text. When you work on a project like this for months at a time, it’s difficult to be objective about it and see things as clearly as fresh sets of eyes can. Thanks to all of the readers who have taken the time to add a report to the official errata list, or to make a post to the book’s forums, or to fire off an e-mail to me. Many of your suggestions have already been incorporated, and I’m keeping track of all of them as I evaluate which changes to make in subsequent releases.

FXRuby Book Now Available as Beta Release!

I’m pleased to report that FXRuby: Create Lean and Mean GUIs with Ruby has been released as a Beta book. That means that although the book is still under development, you can get early access to the content right now and provide feedback to help make the final book even better when it’s released later this year. We’re getting very close to a completed first draft and I can assure you that it’s well worth it to go ahead and get the book now if you’re anxious to get started with FXRuby programming.

As I’ve noted before, this is the first book ever dedicated to the subject of FOX and FXRuby application development. It’s intended for software developers who are already comfortable with Ruby programming and who want to learn how to develop GUI applications with Ruby. No prior experience with GUI development is needed, but it’s intended to be useful both to newcomers as well as those who have worked with other GUI toolkits in the past.

The purpose of this book is to give you a head start on developing GUI applications with Ruby and FXRuby through a combination of tutorial exercises and focused technical information. It isn’t a comprehensive book on FXRuby programming, and it’s not a reference manual. What this book will do is get you over the initial conceptual hurdles and equip you with the practical information that you need to build your own applications. Surf on over to the Pragmatic Bookshelf site and order your copy today!

Would you like to be a reviewer?

Some of you may know that I’m writing a book about FXRuby for the Pragmatic Bookshelf. I’m almost finished with the first draft, and I’m looking for some volunteers to review the book. Specifically, I’m looking for people to go over the book with a fine toothed comb, looking for inconsistencies, things that are confusing or misleading, and outright errors. When there are example programs, I’d like for you to try to run the programs and make sure they work the way the book claims that they work. That sort of thing. Depending on how fast you can read and absorb the material, and then provide feedback based on what you’ve seen, a thorough review might take a few hours or a few days.

In a nutshell, the book is aimed at folks who do know Ruby but who don’t necessarily know anything about FOX/FXRuby or GUI programming in general. That’s the target audience for the book. It’s not a comprehensive book about all things FOX and FXRuby, and a lot of the more advanced topics are intentionally left out. The idea is that after reading this book, you’ll have enough of a foundation to tackle some of those more advanced topics on your own.

If you’re interested in being a reviewer, and (more importantly) if you believe that you have the time to do this, please respond in the comments, or contact me as soon as possible. We’re looking to release it as a beta book as soon as next week, and we’d be getting the completed first draft out to reviewers shortly after that.

Update: Well, that went fast! Looks like I now have plenty of reviewers lined up. Stay tuned for further announcements about the beta book release!