Re: [Fxruby-users] Dynamically created non-modal dialogs?
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@kn...> - 2004-02-27 18:26:03
|
On Feb 27, 2004, at 11:48 AM, Kevin Burge wrote: > I'm looking at the dialogs example, and it looks like the only > difference between a modal and non-modal dialog is that the non-modal > dialog was created in the initialization. > > I just did a test with a dialog that I know works, and it is true: a > modal dialog is made non-modal just by moving it to the initialization > method. Well, not quite. There's nothing about the dialog box itself (including when it's created) that inherently makes it modal or non-modal. It depends on how you "invoke" the dialog box (for lack of a better term). To display a dialog box non-modally, just call show() on it: aDialogBox.show To show a dialog box and then start a modal event loop for it, you can instead use the execute method: aDialogBox.execute The FXDialogBox#execute method is just a simple convenience method; if it were implemented in Ruby, it would look something like this: def execute(placement=PLACEMENT_CURSOR) create show(placement) getApp().runModalFor(self) end Hope this helps, Lyle |