Allow none arguments in functions

master
Yevgen Muntyan 2006-03-03 19:28:28 -06:00
parent b080a1da21
commit c8c560a326
2 changed files with 6 additions and 6 deletions

View File

@ -29,11 +29,11 @@ entry_func (MSValue **args,
GtkWidget *dialog, *entry;
MSValue *result;
if (n_args > 0)
dialog_text = ms_value_print (args[0]);
if (n_args > 1)
entry_text = ms_value_print (args[1]);
if (n_args > 2)
if (n_args > 0 && !ms_value_is_none (args[0]))
entry_text = ms_value_print (args[0]);
if (n_args > 1 && !ms_value_is_none (args[1]))
dialog_text = ms_value_print (args[1]);
if (n_args > 2 && !ms_value_is_none (args[2]))
hide_text = ms_value_get_bool (args[2]);
dialog = gtk_dialog_new_with_buttons (NULL, ctx->window,

View File

@ -20,7 +20,7 @@
G_BEGIN_DECLS
/* Entry(dialog_text = none, entry_text = none, hide_text = false) */
/* Entry(entry_text = none, dialog_text = none, hide_text = false) */
MSFunc *ms_zenity_entry (void);
/* Text(text = none, dialog_text = none) */
MSFunc *ms_zenity_text (void);