[fxruby-users] FXTopWindow

Jeroen van der Zijp jeroen at fox-toolkit.org
Thu Nov 20 00:19:01 EST 2008

On Wednesday 19 November 2008, angico wrote:
> Hi, all.
> I'm trying to create a "timed" dialog, i.e., a dialog that remains
> visible for a specified amount of time or until a user clicks any of its
> buttons (OK, Cancel, etc).
> I've tried to extend this dialog from FXDialogBox, but I just can't get
> out of its modal loop. So I thought of extending FXTopWindow, but it
> claims to be an "abstract base class" and I don't know exactly how to
> extend it.

To get out of the modal loop, FXDialogBox calls app->stopModal(); this can
be most easily accomplished via ID_CANCEL or ID_ACCEPT messages being sent
to the dialogbox [they differ mainly in the return code passed along through

You can certainly also call accept in response to a timeout.  In fact, handlers
for timeout and chores have already been added to FXDialogBox: SEL_TIMEOUT,
SEL_COMMAND, and SEL_CHORE with ID_CANCEL or ID_ACCEPT are available.

So basically all that's needed is to set the timer to send the (SEL_TIMEOUT,ID_CANCEL)
message to FXDialogBox at the desired time.

Hope this helps,

		- Jeroen

| Copyright (C) 23:10 11/19/2008 Jeroen van der Zijp.   All Rights Reserved. |

More information about the fxruby-users mailing list