[fxruby-users] Exiting a DialogBox created with FoxGUIb
erne at powernav.com
Sat Dec 9 16:51:20 EST 2006
e aldaz wrote:
> Dear All
> I am new to FOX and FoxGUIb. I have found FoxGUIb very
> useful and I have created an application with menus,
> one of which calls a DialogBox for the user to enter
> some values. After finishing the user will press OK to
> save data.
> Unfortunately I don’t know how to let the
> DialogBox know tha tonce the OK button is pressed it
> should exit. It seems I need to send message ID_ACCEPT
> to some recipient (not sure which) when the button OK
> is clicked? But no idea how to do that with the code
> that is generated by FoxGUIb as the button is created
> in a different way to what I have seen in the examples
> in the web, and I have no idea how to relate them (
> I'm afraid I haven't really understood the FXButton
> The dialog box examples I have seen do something like
> the following:
> # Accept
> accept = FXButton.new(buttons, "&Accept", nil,
> self, ID_ACCEPT,
> However the FoxGUIb creates a button doing:
> lat = textfield_lat.text
> lon = textfield_lon.text
> do I indicate that I want to accept and exit?:?
> So in this last example, how do I exit the dialog when
> button is clicked?
> Thanks very much for your help
> Hi Eduardo:
Take a look at the example dialog.rb in the examples dir that came
There they have a function
def onCmdShowDialogModal(sender, sel, ptr)
That example should solve your problem.
If you don't have the examples file look here
In the documentation, there are examples. The dialog.rb example is
there along with the code.
More information about the fxruby-users