From: Lyle Johnson Date: 2003-05-21T23:17:46+09:00 Subject: Re: FXRuby - FXMainWindow question John Reed wrote: > I did as you suggested and put the entry portion of my database on a > dialog box. I just issue this command to show the dialog box: > > @@dialog.show > > If I have the dialog box accept and cancel message identifiers tied > to a menu item, how can I capture what menu option was taken when the > control returns to my main class? > > FXMenuCommand.new(filemenu, "&Accept", nil, self, ID_ACCEPT) > FXMenuCommand.new(filemenu, "&Cancel", nil, self, ID_CANCEL) If you were to display that dialog box modally (by calling execute), you can just check the return value of FXDialogBox#execute, e.g. def showEntryDialog exitCode = @@dialog.execute if exitCode != 0 # user clicked "Accept" to terminate the dialog box end end If you're displaying the dialog box non-modally (i.e. by just calling show() on it) I don't think that there is a way to *directly* recover those termination codes.