By Developers, For Developers

Historical errata for FXRuby

PDF PgPaper PgTypeDescriptionFixed onComments
24SUGGEST

I am using the Acrobat Reader, Version: 7.0.5.2005092300.
There are some links in the pdf which point to images. But they link to the text below the image and the image is just above it, so that I can read the text, but the image isn’t visible(above, not on the screen).
Is it possible to change it, so that when I click on a link, like 2.1(page 24) or 1.2(page 20), I can see the image.

Kindly, Thomas

2008-01-22
26DEFER

I am just so far as page 26, but I searched for more occurrences of the Photo and Album attribute :title and it’s just on that page.
Don’t you think that
attr_accessor :title
is better than
attr_reader :title
I think that it should be possible to change the title of a photo/album.

49ERROR

The album view is not working correctly when the first picture is in vertical format and not MAX_WIDTH

def layout
  super
  # Lyle's solution
  # self.numColumns = width/childAtIndex(0).width if numChildren > 0
  # my working solution
  # the if clause isn't need anymore IMHO
  self.numColumns = self.width / PhotoView::MAX_WIDTH 
end

I’ll mail two screenshots to Lyle’s email address to better illustrate it.

2008-01-22
53ERROR

The code for layout() is not working the way you display it. I think people with little Ruby knowledge will probably see it directly, but I’ll add it just for completeness.

def layout
        super
        contentWindow.numColumns = 
            contentWindow.width / PhotoView::MAX_WIDTH 
                if self.contentWindow.numChildren > 0
    end

The if-clause is as mentioned in errata #30451(I kept my MAX_WIDTH change) not needed anymore, but when I used the code as is, Ruby doesn’t connect the if to the lines above and returns an error

2008-01-22
46SUGGEST

I took a look at the documentation and I used right away the @patternList attribute. I think it is useful for the application and I was annoyed seeing other files :)

    def add_menu_bar
        # ...
        import_cmd = FXMenuCommand.new(file_menu, "Import...")
        import_cmd.connect(SEL_COMMAND) do
            dialog = FXFileDialog.new(self, "Import Photos")
            dialog.selectMode = SELECTFILE_MULTIPLE
            # Included that here
            dialog.patternList = ["JPEG Images (*.jpg, *.jpeg)"]
            dialog
            if dialog.execute != 0
                import_photos(dialog.filenames)
            end
        end
    end
2008-01-22
57TYPO

The initialize() method of AlbumView is changed, but there’s no code how it was done:
In PictureBook from
album_view = AlbumView.new(self, album)
to
album_view = AlbumView.new(self, LAYOUT_FILL|LAYOUT_SIDE_RIGHT|MATRIX_BY_COLUMNS, album)
(I have added MATRIX_BY_COLUMNS, I think it is still neccessary, but I didn’t it without yet)

The new initialize() should probably look like that:

    #def initialize(p, album)
    def initialize(p, opts, album)
        #super(p, :opts => LAYOUT_FILL|MATRIX_BY_COLUMNS)
        super(p, :opts => opts)
        # ...
    end


(old code in comments)

2008-01-29
17SUGGEST

Starting with the “Hello, World!” example, the samples all start with “require ‘fox16’”. Since FXRuby is installed as a gem, this won’t work on Ruby < 1.9.0 without a preceding “require ‘rubygems’”. There should probably be a note about this, since many people are likely to still be using 1.8.x when this book is released.

2008-01-22
29ERROR

The code listing for PhotoView# is missing the method body (i.e., super(p, nil) / load_image(photo.path)) and the load_image method.

2008-01-22
37TYPO

Text reads:

“Don’t forget to add the necessary require statements to album_view.rb and photobook.rb so that the definitions of the Album, AlbumView, Photo and PhotoView classes are visible.”

photobook.rb does not exist anywhere else in the text, so I’m assuming it should be picturebook.rb.

2008-01-22
37SUGGEST

I found it somewhat distracting to see partial code snippets out of context (i.e., I’m having to download the file constantly to see the snippets in context). In a paper book, this would most likely require me to constantly flip to the appendices to get the same continuity. It might be better to show the entire class (or at least the location within the class) and then discuss the snippet.

2008-01-22
56TYPO

Repetition error at the end of this sentence:

“The first order of business is to think about the view for the album list, and how we might implement that and how we might implement that.”

Should probably read:

The first order of business is to think about the view for the album list, and how we might implement that.

2008-01-22
28ERROR

The code to download on page 28 does not match the code displayed in the book. The downloadable code includes these two lines, and the last one causes problems:

require ‘photo’
require ‘photo_view’

photo_view has not yet been created.

Please align code with book (or vice versa).

2008-01-22
49TYPO

Bottom of the page:
“Finally, to provide the user with a means to select the files
that she wants to to import into the album,”

There’s an extra “to”.

2008-03-14
54TYPO

“If you take a close look at the rightmost edge of the window, you’ll see that that last photo is clipped.”

2008-03-14
28ERROR

The call to Fox::FXMainWindow.new includes the symbols :width and :height. I get an error: wrong argument type Hash (expected Data) (TypeError)

Versions: Ruby 1.8.6, Fox 1.6

Note from Author Lyle Johnson:

“The fact that you’re seeing this error message suggests that you’re
using an out-of-date version of FXRuby. Please upgrade to a more
recent version; the current release is version 1.6.14. If the problem
persists, or you need additional assistance, please follow up on the
FXRuby Users mailing list.”

51ERROR

Around the middle of the page, where it says “Next, we construct an FXMenuPane window, as a child of the FXMenuBar”, it should read, “… as a child of the main window”. (Reported to me by a reader).

103TYPO

In Figure 8.4, the bottom two labels read “Sunken and Thick Frame”, whereas it actually is raised with a thick frame, and “Raised and Thick Frame”, whereas is actually is sunken with a thick frame (see lines 27 and 28 of the program lableexample3.rb)

59TYPO

“In addition to the parent window, we’re going to pass in the LAYOUT_FILL …”

I’ve been typing the code in as I read the book, and I already have LAYOUT_FILL. My current code looks like:

super(p, :opts => LAYOUT_FILL|MATRIX_BY_COLUMNS)

87TYPO

On p. 87, “SCROLLOCK” should be SCROLLLOCK" (i.e. 3 “L”s).

15TYPO

hello.rb
you forget the line
require ‘fox16/kwargs’

Helmut Hagemann

xml_user@web.de
great book

84ERROR

example of creating an input for FXApp with IO.popen(“tail -f /var/log/system.log”)
should be:

app.addInput(@pipe, INPUT_READ) do
# respond to the new data
end

instead of INPUT_WRITE

11TYPO

Since FOX draws it>s< own widgets, …

123TYPO

A spanning item is one that takes up more tha>t< one position in the table. (n)

170TYPO

…FXTable widget, which >we'll look at< in Section 9.4,… (we looked at)

176TYPO

…, the first child of the >FXS-plitter< appears (bad hyphenation at line end)

176SUGGEST

It’s considerate to save the sizes of the subpanels >to the registry< (isn’t there a move afoot to save configuration info in separate application-specific files instead of the registry? At least show how to do it both ways and give the reader the choice.)

181TYPO

Inconsistency: “Source >T<ext” occurs on pages 181-184 in several places, while the counterpart string “Translated >t<ext” has different capitalization.

190TYPO

… are just a couple >(of)< examples of the possible…

204SUGGEST

Once the user is finished … and has made >their< selection (his or her is more grammatical).

207SUGGEST

… displaying it to the user to collect >their< inputs, … (his or her is more grammatical)

211TYPO

… with other software developers.>(space needed)<Section 1.4, …

Categories: