[fxruby-users] Closing a modal FXDialogBox correctly?

Philippe Lang philippe.lang at attiksystem.ch
Wed Jan 31 13:07:38 EST 2007

Jeroen van der Zijp wrote:
> On Wednesday 31 January 2007 11:11, Philippe Lang wrote:
>> Hi,
>> Very rarely, I have a bug when closing a modal dialog box.
>> What is the 100% correct way of closing a modal dialog box,
>> programmatically, from within the dialog code itself?
> To close the dialog, the ID_ACCEPT or ID_CANCEL message is used,
> which (1) breaks out of the modal loop and (2) hides the window. 
> Implied herein is that you've started the modal loop via the dialog's
> execute() function [or with runModalFor()]. 
> The modal event loop is a re-incarnation of the event loop which
> won't return to the caller until the stopModal() function is invoked. 
> Note that the window argument in runModalFor() and stopModal() must
> match up; perhaps that is the problem? 


Thanks for your answer.

I'm starting all the dialogs with a call to "execute", so I don't have
to pass any specific parameter as an argument.

Is there a chance there can be in very rare occasions some sort of
"concurrency" problem when closing a dialog which is receving a fox
message mostly in the same time? And that the code triggered by the fox
message relies on a "half-closed" dialog somehow? I ask this because I
got twice a message which is "This FXTextField * already release". All
my dialogs contain at least one "FXTextField"...

Note that I'm using the Ruby bindings. Is there a chance the problems
comes from here?



More information about the fxruby-users mailing list