> I am just trying to put together my first GUI application with FXRuby.
> My app has an input window and an output window. The output window should
> display either a text field with messages (kind of log) or a tabular
output.
> At the moment I use FXTabBook for switching between these two views.
>
> The problem is I need automatically switch to text if there is no table
data
> available and vice versa. I tried to use setFocus but it really just sets
> the focus and do not set the tab item visible.
>
> Perhaps there is a better way to do it? I thought about showing/hiding the
> widgets and let the user switch them by a button.

I hope I understand what it is that you want to happen. I think you're
saying that you want to continue to use the tabbed book, with the text area
on one page and the table on another page, but you'd like to be able to
programmatically switch pages instead of making the user click on a tab to
select the appropriate page.

If that's the case, you just call setCurrent() on the tab book, passing in
the index of the tab you want raised to the top. If you've just got the two
tabs you mentioned, you'll either call:

    tabBook.setCurrent(0)

or

    tabBook.setCurrent(1)

Hope this helps,

Lyle