> That's a good idea, but I would still need some kind of container because
I
> need multiple FXLabel's in the status area: one for the "last" message
(``Log
> saved to foo'', etc.) and another one (on the far bottom right) for the
number
> of log entries. What kind of container should I use instead of
FXStatusbar?

Jos and I have already been discussing this off-line, but to summarize you'd
want to use an FXHorizontalFrame, e.g.

    # This is the container for the label(s) along the bottom. It is
    # actually invisible and only used to lay out the labels themselves.
    @statusFrame = FXHorizontalFrame.new(contents,
        LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X)

    # Here's the label which will display the number of entries.
    # Use FRAME_SUNKEN so that it stands out (or in, if you
    # like) from the other label(s) on the status line. Use LAYOUT_RIGHT
    # to ensure that it's placed flush against the right-hand side of its
    # parent horizontal frame; by default, FXHorizontalFrame just
    # arranges it children from left-to-right.
    @numEntries = FXLabel.new(contents, "Entries: 0", nil,
        FRAME_SUNKEN|LAYOUT_FILL_Y|LAYOUT_RIGHT)

    # Use JUSTIFY_LEFT for this label to ensure that the label text is
    # (quick, guess!) left-justified instead of the default for labels,
which
    # is centered text.
    # Specifying LAYOUT_FILL_X for this label says that it will stretch
    # to take up any remaining space in its parent frame, similar to the
    # expand & fill options from Tk's Packer widget.
    @lastMessage = FXLabel.new(@statusFrame, "Log saved...", nil,
        JUSTIFY_LEFT|FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y)

> Another question while I am here: is there a way to detect whether the
Enter
> key was pressed in an FXTextField?
<... snip ...>
> which mostly works. I tried using SEL_COMMAND instead but every time I
click
> some button in my script this block is called also. Since the button also
> causes addevent to be called I end up with two events, whereas I really
only
> want this block to be called when I hit Enter.

Yes, FXTextField sends SEL_COMMAND as a kind of "commit" message and at that
point you can't really tell whether they did so by pressing the Enter key or
by changing the focus (i.e. clicking on some other widget). I was going to
suggest that you instead catch the SEL_CHANGED message, which is sent every
time the text field's contents change (i.e. by adding or removing
characters) but it looks like the Enter keypress is caught even before that
(in the SEL_KEYPRESS handler). To get the effect you want, I think you're
going to have to back up all the way to the SEL_KEYPRESS handler and check
to see if they've hit the Enter key there, e.g.

    # Handle SEL_KEYPRESS events instead of SEL_COMMAND or
    # SEL_CHANGED
    @comment.connect(SEL_KEYPRESS) do | sender, sel, event |
        if (event.code == KEY_Return) || (event.code == KEY_KP_Enter)
            # User clicked the Enter key; save this event message and then
            # return 1 from this handler to let FOX know that we've handled
            # the event.
            return 1
        else
            # It wasn't the Enter key, so we return 0 to let FOX know that
            # we didn't handle this event and we want the text field to
handle
            # it like it usually would...
            return 0
        end
    end

Needless to say, I haven't actually tried this code yet ;) Let me know how
it goes.

> My apologies for being dense; if somebody writes a book on FXRuby I'll buy
it
> right away.

There's not a whole book on FXRuby (or FOX for that matter), but FXRuby is
discussed in at least two new books: "The Ruby Way", by Hal Fulton; and the
"Ruby Developer's Guide", by Michael Neumann (ed.), Robert Feldt, Jonothon
Ortiz and, yes, me. Both of these should be available (or available soon)
from your favorite online or offline bookseller.