[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlighting




=> Is it possible to highlight a subtree in a window, which has not be clicked
=> with the mouse (starting only from a calculated path)? I tried but it doesn't
=> work until now.

Yes, any selection may be displayed in a ctedit.
Pages 96 and later of the Centaur tutorial explain how this can be done.

Let's take a ctedit <ct>, which contains a {variable} as subject.

(setq var ({ctedit}:subject ct))

Create a selection:
(defabbrev demo {selection}:demo)
({variable}:add-selection var '{demo})

Create a select (a graphical encapsulation of a selection, bound to a ctedit):

({ctedit}:create-select ct '{demo} '{textual}:all)

Build a path:
(setq path
   (let ((tree ({tree}:down ({variable}:root var) 1)))
       ({tree}:path tree)
       )
   )

Update the selection:

({selection}:change ({variable}:find-selection var '{demo}) path)

Update the ctedit structure:

({ctedit}:update-select ct ({ctedit}:find-select ct '{demo}))

Redisplay changes:

({ctedit}:incremental-redisplay ct)


=> P.S.: Concerning my previous question(s) about the annotation of trees
=> with paths, I have now a working version, which transforms paths in strings
=> and then annotates trees with these strings, but I am not very satisfied...
=> If there is another possible solution, I would be very happy to know it.

There is no VTP class to represent paths. The implementation of a new vtp
class, including polish operations, is very difficult and should not be
considered as a possible solution.
You have encoded paths as strings, you could also have used a vtp formalism.
There already exists a formalism to represent paths as trees, it is called PSP
and is used in TYPOL. Maybe you could use this formalism, too.


	Vincent Prunet