So that when someone simply presses Enter without entering anything in the box it returns an empty string. Hitting Esc or the Cancel button should still return None. Right now, it simply refuses to close and return if you try hitting Enter without typing anything, it just stays up, waiting.
This would make it handy to be able to use StringBox to ask for an optional string - that might used as a prefix or suffix for something else for example. Hitting Enter without typing anything would mean you don’t want to add the prefix/suffix. Right now, I can only use GetString for that, but entering a text with spaces causes it to return after the first space - whereas StringBox() will allow spaces in the string.
Note that StringBox()
just calls rhinoCommon Rhino.UI.Dialogs.ShowEditBox()
, and the problem is with the RhinoCommon method, not in how the rhinoscriptsyntax call is written.