Commits

Anonymous committed 2a477aa

Allow none arguments in functions

  • Participants
  • Parent commits fdfa1d3

Comments (0)

Files changed (2)

moo/mooutils/mooscript/mooscript-zenity.c

     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,

moo/mooutils/mooscript/mooscript-zenity.h

 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);