TkObject js Object

TkObject js Object


  • interp
  • name
  • widget_obj

Container for a Tk widget. This is the instantiated command object, which is created when a Tk widget like a button for example is instantiated. It contains a TkWidget js Object, which holds the specific info for that instance of the widget. Also all the specific option values for that widget are collected here and can be modified and fetched using the configure and cget sub command of the widget.

When setting an option with the configure command, the option name and value are mapped from the Tk values to the the style or attribute name and the appropriate value for javascript.

For example the Tk option -foreground is mapped to the javascript style attribute “color” and the -text option of a Tk button is mapped to the “textContent” field when using Firefox. That is still a different field name for IE, which has yet to be implemented.

(Part of Tk Widgets in Javascript Paper)