/** * fm_ask_valist * @parent: toplevel parent widget * @title: title for the window with question * @question: the question to show to the user * @options: va_arg list of button labels * * Ask the user a question with several options provided. * * Before 0.1.16 this call had different arguments. * * Return value: the index of selected button, or -1 if the dialog is closed. * * Since: 0.1.0 */ int fm_ask_valist(GtkWindow* parent, const char* title, const char* question, va_list options) { GArray* opts = g_array_sized_new(TRUE, TRUE, sizeof(char*), 6); gint ret; const char* opt = va_arg(options, const char*); while(opt) { g_array_append_val(opts, opt); opt = va_arg (options, const char *); } ret = fm_askv(parent, title, question, &opts->data); g_array_free(opts, TRUE); return ret; }
static gint on_ask (FmFileOpsJob *job, const char *question, const char **options, FmProgressDisplay *data) { ensure_dlg (data); return fm_askv (GTK_WINDOW (data->dlg), NULL, question, options); }