Navigation:  thinBasic Modules > UI (User Interface) > DIALOGSs >

DIALOG SHOW MODELESS

Previous pageReturn to chapter overviewNext page

 

Description

 

Display and activate a dialog previously created with DIALOG NEW ..., allowing it to receive user input and messages.

Execution of the code continues at the same time as the dialog is displayed.

 

Syntax

 

DIALOG SHOW MODELESS hwnd [[,] CALL cbFunction]

 

Returns

 

None

 

Parameters

 

Name

Type

Optional

Meaning

hwnd

Number

No

Handle of the dialog created with DIALOG NEW ... statement

cbFunction

Function

Yes

Name of the function that to which dialog messages will be routed to.

The nominated callback function name must be a CALLBACK FUNCTION or a run-time  error will occur.

The name of the callback function can be also specified as a string expression allowing great flexibility.

 

Remarks

 

Execution of the program continues at the same time as the dialog is displayed.

Modeless dialogs require a message pump to be running for the duration of the dialog.

 

Restrictions

 

See also

 

Examples

 

'----------------------------------------------------

'---Single modeless dialog message pump example.

'---(Assume dialog already created with DIALOG NEW ...)

'----------------------------------------------------

  DIALOG SHOW MODELESS hDlg Call DlgCallback

  Do

    DIALOG DOEVENTS 0 To Count

  Loop While Count

  ' Application code continues here...

'----------------------------------------------------

 

 

'----------------------------------------------------

'---Multiple modeless dialog message pump example.

'---In some applications, the number of modeless dialogs can vary,

'---we want to break the message loop when the 'main' dialog is closed.

'---(Assume dialogs already created with DIALOG NEW ...)

  DIALOG SHOW MODELESS hMainDlg Call DlgCallback

  DIALOG SHOW MODELESS hChildDlg1

  DIALOG SHOW MODELESS hChildDlg2

  ...

  Do

    DIALOG DOEVENTS

    DIALOG Get SIZE hMainDlg To x, x

  Loop While x       '---When x = 0, dialog has ended

  ' Application code continues here...

'----------------------------------------------------