UNPKG

@kvaser/canking-api

Version:

CanKing API to communicate with the CanKing service using Node.js.

52 lines (27 loc) 1.08 kB
[**Kvaser CanKing GUI Extensions SDK v7.5.1**](../../README.md) *** [Kvaser CanKing GUI Extensions SDK](../../modules.md) / [ipc](../README.md) / showQuestionBox # Function: showQuestionBox() > **showQuestionBox**(`message`, `title`, `buttons?`, `defaultId?`, `cancelId?`): `Promise`\<`number`\> Displays a question box for the user. ## Parameters ### message `string` The message/question to display. ### title `string` The dialog title. ### buttons? `string`[] Captions of the buttons that should be present, defaults to ['Yes', 'No']. ### defaultId? `number` Index of the button in the buttons array which will be selected by default when the message box opens. ### cancelId? `number` The index of the button to be used to cancel the dialog, via the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the label. If no such labeled buttons exist and this option is not set, `0` will be used as the return value. ## Returns `Promise`\<`number`\> The index of the button that was clicked.