Skip to content

Dom.DialogShow

boxgaming edited this page Jul 13, 2026 · 1 revision

Displays the specified dialog element as a non-modal dialog.
A non-modal dialog is one where users can interact with content outside/behind the open dialog.
Available in release 0.11.0

Syntax

Dom.DialogShow dlg

Parameters

  • The dlg parameter specifies the HTML dialog element to show.

Example

Import Dom From "lib/web/dom.bas"

Screen NewImage(320, 200, 32)

Dim Shared dlg As Object
dlg = Dom.Create("dialog", , _
    "<p>This is a popup dialog.</p>" + _
    "<button id='btn-close'>Close</button>")

Dim btnClickMe As Object
btnClickMe = Dom.Create("button", ,"Click Me!")
Dom.Event btnClickMe, "click", @OnBtnClickMe

Dim btnClose As Object
btnClose = Dom.Get("btn-close")
Dom.Event btnClose, "click", @OnBtnClose

Print "Press any key to show the dialog..."
Sleep

' The "click me" button will respond to events
' when the dialog is opened in this mode.
Dom.DialogShow dlg

Sub OnBtnClose
    Dom.DialogClose dlg
End Sub

Sub OnBtnClickMe
    Print "You clicked me!"
End Sub

See Also

Dom.DialogClose
Dom.DialogShowModal
JavaScript HTMLDialogElement: show()

Clone this wiki locally