Go to the source code of this file.
|
| typedef struct _NvdDialogBox | NvdDialogBox |
| | A type to identify a single dialog box.
|
| typedef struct _NvdQuestionBox | NvdQuestionBox |
| | A similar struct to NvdDialogBox, but instead used for question dialogs.
|
◆ NvdDialogBox
A type to identify a single dialog box.
- Note
- You can only use a dialog box once. Reusing it is undefined behavior. Example:
#include <nvdialog/nvdialog.h>
int main(int argc, char** argv) {
"A simple dialog box.",
if (!dialog) return -1;
return 0;
}
NVD_API void nvd_free_object(void *object)
Deletes an object creates by NvDialog.
NVD_API int nvd_init()
Initializes NvDialog.
struct _NvdDialogBox NvdDialogBox
A type to identify a single dialog box.
Definition nvdialog_dialog_box.h:49
NVD_API void nvd_show_dialog(NvdDialogBox *dialog)
Shows a dialog to the system shell.
NVD_API NvdDialogBox * nvd_dialog_box_new(const char *title, const char *message, NvdDialogType type)
Creates a new dialog object and returns it.
@ NVD_DIALOG_SIMPLE
Definition nvdialog_types.h:42
- Since
- v0.1.0
◆ NvdQuestionBox
A similar struct to NvdDialogBox, but instead used for question dialogs.
- Since
- v0.1.0
◆ nvd_dialog_box_get_raw()
Returns the raw object behind the dialog.
- Parameters
-
| dialog | The dialog to retrieve the object from. |
- Returns
- void* The raw toolkit-created object.
- Warning
- On Windows this will always return NULL, as the dialog is created on the spot upon showing it (See MessageBox for details.)
◆ nvd_dialog_box_new()
Creates a new dialog object and returns it.
This function creates a simple dialog with the specified arguments, and returns an opaque handle to it for use with nvd_show_dialog.
- Returns
- The dialog handle on success, else NULL.
- Since
- v0.1.0
◆ nvd_dialog_box_set_accept_text()
| NVD_API void nvd_dialog_box_set_accept_text |
( |
NvdDialogBox * | dialog, |
|
|
const char * | accept_text ) |
Sets the accept text for the dialog (The "Ok" button label).
- Parameters
-
| dialog | The dialog to change the button label. |
| accept_text | The new label of the dialog button. May not be NULL. |
- Warning
- This function has no effect on Windows - The system will decide the button's text based on language and user preferences.
- Since
- v0.8.0
◆ nvd_dialog_question_get_raw()
Returns the raw object behind the dialog.
- Parameters
-
| dialog | The dialog to retrieve the object from. |
- Returns
- void* The raw toolkit-created object.
- Warning
- On Windows this will always return NULL, as the dialog is created on the spot upon showing it (See MessageBox for details.)
◆ nvd_dialog_question_new()
Creates a question dialog box with the given parameters. This function creates a dialog box containing a question with a few buttons such as:
- Yes / No
- Yes / No / Cancel
- Yes / Cancel
- Returns
- The NvdReply on success, else -1 – Check nvd_get_error for more.
- Since
- v0.1.1
◆ nvd_get_reply()
Shows the question dialog given to the system and returns the choice given.
- Parameters
-
| box | The box to use to show the reply. |
- Returns
- The reply from the dialog box.
◆ nvd_show_dialog()
Shows a dialog to the system shell.
The dialog given is rendered to the screen when this function is called. Note that this function works even on headless environments, although it will not produce any result.
- Parameters
-
| dialog | The dialog to show. |