mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 04:22:47 -05:00
Make the GTK message-box function non-variadic.
Now, in place of a variadic argument list with four parameters per button and a terminating NULL, it takes a pointer to a struct which in turn contains an (array,length) pair of small per-button structures. In the process I've renamed the function from messagebox() to message_box(). Partly that was just because it gave me a convenient way to search the source for calls I hadn't converted yet, but also I've thought for a while that that missing underscore didn't really match the rest of my naming. NFCI. Partly this minor refactor has the virtue that we can reuse the more common button layouts without having to type them in at multiple places in the code (and, indeed, I've provided buttons_yn and buttons_ok for easy reuse, and could easily provide other things like yesnocancel any time I need them). But mostly it's because I'm about to split up message_box into multiple functions, and this saves me the hassle of deciding which ones to make variadic and which to pass an actual va_list to - particularly since messagebox() used to go over its variadic argument list twice, which always makes delegating it to another function that much more annoying.
This commit is contained in:
@ -4125,10 +4125,10 @@ static void after_change_settings_dialog(void *vctx, int retval)
|
||||
char *msgboxtext =
|
||||
dupprintf("Could not change fonts in terminal window: %s\n",
|
||||
errmsg);
|
||||
messagebox(inst->window, "Font setup error", msgboxtext,
|
||||
string_width("Could not change fonts in terminal window:"),
|
||||
FALSE, "OK", 'o', +1, 1,
|
||||
NULL);
|
||||
message_box(inst->window, "Font setup error", msgboxtext,
|
||||
string_width("Could not change fonts in terminal"
|
||||
" window:"),
|
||||
FALSE, &buttons_ok);
|
||||
sfree(msgboxtext);
|
||||
sfree(errmsg);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user