DialogModule. SDL's Missing Dialog API. No Dynamic or Static Library Required


#1

#include “DialogModule.h” for C++ Projects: GitHub | SourceForge Permissive MIT License. Written in C++, but can also be used in C.

Available for Windows, Mac OS X, and Linux. On Linux both GTK+ and KDE Dialogs are supported. For KDE dialogs, use: widget_set_system((char *)“KDialog”);

The excessive use of double’s and char pointers is due to the fact the source code is also used for a GameMaker Studio 2 extension library, which requires these data types for exported functions’ arguments and return values.

Functions included:

double show_message(char *str)
double show_message_cancelable(char *str)
double show_question(char *str)
double show_question_cancelable(char *str)
double show_attempt(char *str)
double show_error(char *str, double abort)
char *get_string(char *str, char *def)
char *get_password(char *str, char *def)
double get_integer(char *str, double def)
double get_passcode(char *str, double def)
char *get_open_filename(char *filter, char *fname)
char *get_open_filename_ext(char *filter, char *fname, char *dir, char *title)
char *get_open_filenames(char *filter, char *fname)
char *get_open_filenames_ext(char *filter, char *fname, char *dir, char *title)
char *get_save_filename(char *filter, char *fname)
char *get_save_filename_ext(char *filter, char *fname, char *dir, char *title)
char *get_directory(char *dname)
char *get_directory_alt(char *capt, char *root)
double get_color(double defcol)
double get_color_ext(double defcol, char *title)
char *message_get_caption()
char *message_set_caption(char *str)
char *widget_get_system() // Returns current widget system
char *widget_set_system(char *sys) // (char *)"Zenity" or (char *)"KDialog"

Official Website:

I hope many people will benefit from this.
Samuel