[fxruby-users] FXDialogBox - how to close

Philippe Lang philippe.lang at attiksystem.ch
Mon Apr 27 01:54:54 EDT 2009


fxruby-users-bounces at rubyforge.org wrote:
> I have an FXDialogBox that I want to programmatically close.  I have
> been unable to figure out how to do it and am baffled! 
> 
> If I add an "Accept" button using this code:
> 
>     accept = FXButton.new(buttons, "&Accept", nil, self, ID_ACCEPT,
>       FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
> 
> the dialog exits properly when I hit the button.  BUT...I don't want
> to have a button in the dialog.  When the user selects an item from a
> listbox, I just want to do the same thing as "Accept".  I have tried
> having the dialog close itself.  The window closes but the parent
> window thinks it still exists (The dialog is "modal").  Nothing I
> have tried closes the dialog box and lets the parent window function
> normally.      

Hi,

Maybe you can try this:

  # Closes the dialog.
  def closeDialog
    close
    $app.stopModal
  end

... where $app is your application object.

Best regards,

Philippe Lang
Attik System


More information about the fxruby-users mailing list