"-command" option, where argument of a procedure has space...



Noticed annoying thing:

Created a simple menu using ttk::menubutton, where a commands have been
added to each entry. The command option looked like:

-command "makeThis $parameter"

Procedure makeThis has been defined, that it has just one argument.

The problem was, when $parameter had space inside; there was immediately
"wrong # args" error reported. So I had to change it to:

-command [list makeThis "$parameter"]


But I think, the present "-command" behaviour is buggy. The $parameter is
_one_ string, just (sometimes) with space inside. It should be noticed, and
not treated like this:

-command "makeThis $parameter $another_parameter"

My opinion seems to be confirmed by example:

#v+
tclsh8.5 [~]proc sayit { what } { puts $what }
tclsh8.5 [~]set a "Hallo, boys"
Hallo, boys
tclsh8.5 [~]sayit $a
Hallo, boys
tclsh8.5 [~]
#v-

As you can see, the interactive example works properly; it was "-command"
option, which "evaluated"(?) "makeThis $parameter" to 3 separate strings
- instead of keep just two: procedure name, and (just one!) parameter string.

--
ZB
.