Adding a selection

We must now add a highlight selection to the variable structures containing the source tree and the two environment trees. We name this selection {current}:highlight-variable (see the path manual for information about selections). In order to be visible, the selection must be displayed by a select in the ctedit. We choose the select type {textual}:all to display our variable names (see the ctedit manual for information about selects).

The interpreter tool must add the selection to the source ctedit:


(de :create (ctview)
    (lets ((ctedit (send 'object ctview)))
       ...
       ;;Create the highlight select and selection.
       ({ctedit}:create-select ctedit 
                               '{current}:highlight-variable
                               '{textual}:all)
       ...
       ))

We do the same thing in each function that creates an environment view:


(de :initial-env-callback:open-view (stnode port)
    (lets (...
           (ctedit (send 'object view))
           ...
           )
      ;;Create the highlight select and selection.
      ({ctedit}:create-select ctedit 
                              '{current}:highlight-variable
                              '{textual}:all)
      ...
      ))

The same code must be added to :result-view-callback.


Tutorial