Closing a modal dialog in GMS 2.x and GMS 1.x? <p>I have a dialog that needs 3 options, which I have implemented as buttons. It would be best served by a modal dialog. I have code like this:</p> <pre><code>class testDialog : uiframe { void OnOne( object self ) { Result( "Doing one\n" ) self.close() } void OnTwo( object self ) { Result( "Two.\n" ) self.close() } void OnThree( object self ) { Result( "Three.\n" ) self.close() } } void ThreeButtonDialog(String description) { TagGroup dialog_items TagGroup dialog_tags = DLGCreateDialog( "Test Dialog", dialog_items ) dialog_items.DLGAddElement( DLGCreateLabel( description ).DLGAnchor( "North" ) ).dlgexternalpadding(5,5) TagGroup button_items TagGroup button_fields = DLGCreateGroup( button_items ) DLGLayout( button_fields, DLGCreateTableLayout( 3, 1, 0 ) ) TagGroup one_button = DLGCreatePushButton("Option1", "OnOne") TagGroup two_button = DLGCreatePushButton("Option2", "OnTwo") TagGroup three_button = DLGCreatePushButton("Option3", "OnThree") button_items.DLGAddElement(one_button) button_items.DLGAddElement(two_button) button_items.DLGAddElement(three_button) dialog_items.DLGAddElement( button_fields ) Object dialog = alloc( testDialog ).init(dialog_tags) dialog.Display("Test...") DocumentWindow dialogwin=getdocumentwindow(0) WindowSetFrameposition(dialogwin, 300, 200) } ThreeButtonDialog("test") </code></pre> <p>This works fine in DM2. In DM1, however, I get an error: script objects have no close method.</p> <p>Instead, I thought I'd try to close the window. Replace self.close above with:</p> <pre><code>DocumentWindow dialogwin=getdocumentwindow(0) dialogwin.WindowClose(0) </code></pre> <p>This crashes both DM1 and DM2. Is there a better way? Do a modal dialog with radio buttons instead?</p>