Version 0 of Extending the eTcl console

Updated 2006-02-05 18:25:46 by suchenwi

Richard Suchenwirth 2006-02-05 - As I've decided to build my PocketPC "IDE patchwork", under the ceremonial name of Sepp, based on eTcl, here are notes on how components can be plugged in for easy reach: in the console menus, and in the toolbar.

First it is important to know that we're dealing with two "sibling" interpreters here, call them "Main" and "Console" neither being the slave of the other, and each being able to run code in the other:

   set mainres [console eval $consolecode]
   console eval {set consoleres [consoleinterp $maincode]}

This makes coding for both just a little bit more complicated.

Example, to add an item into an existing menu of the console (from htext as eTcl plugin):

 console eval {.menubar.help add command -label Help \
               -command {consoleinterp eval {htext::htext .h}}}

To create a new main item in the console menu:

 (code tomorrow)

With good old introspection I also found out how to add items to the toolbar that appears below the main console window. You just need to hand a 16x16 GIF icon (e.g. picked from iconview as eTcl plugin) to the console interp, and pack into the toolbar:

 (code tomorrow)

Category Development - Arts and crafts of Tcl-Tk programming