Since Tcl uses strings to communicate with the Tk toolkit, parameters to a Tk-command must be translated to strings before calling the C function which implement it. The following conversions are done, depending on the type of the parameter that STK must give to the toolkit:
As an example, let us make a button with a label containing the string "Hello, word". According the original Tk/Tcl documentation, this can be done in Tcl with
gobblecrbutton .hello -text "Hello, world"Following the rewriting rules expressed above, this can be done in STK with
gobblecr(button '.hello '-text "Hello, world")This call defines a new widget object which is stored in the STK variable .hello. This object can be used as a procedure to customize our button. For instance, setting the border of this button to 5 pixels wide and its background to gray would be done in Tcl with
gobblecr.hello configure -border 5 -background grayIn STK this would be expressed as
gobblecr(.hello 'configure '-border 5 '-background "gray")Since keyword colon is replaced by a dash when a ndexfile(index-entry "Tk-command" "tt" aux )Tk-command is called, this expression could also have been written as:
gobblecr(.hello 'configure:border 5:background "gray")