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

Re: Redisplaying/redrawing after modifications



=> 
=> I've written a function that renames all metavariables in the root
=> tree of a ctedit (in order to avoid having two different metavariables
=> with the same name). This is done by changing destructiveley the
=> metavariable's substructure:
=> 
=> 	(rplaca (car ({tree}:sons <meta>)) <new-name>)
=> 
=> Is there a "cleaner" way to achieve the same effect is it ok so?

I don't know a uglier way to do that.

Remember that you are not supposed to know the function {tree}:sons. And you
are not allowed to modify the internal structure of trees.

Look at the documentation (core / The virtual tree processor), there is a
bunch of functions to get/set tree and metavariable values.  

=> Now I want to redisplay the tree, but neither {ctedit}:redisplay nor
=> {ctedit}:incremental-redisplay seem to work. I guess I have to tell
=> explicitely that there has been some updating, but I couldn't
=> figure out how.

You should never call {ctedit}:redisplay. This function is devoted to X events
handling.

The relevant functions are documented in (Core / The cCtedit Editor).

After a modification of the structure of a tree, if the modification was done
using {variable} primitives, the ctedit structure is automatically updated and
incrementally redisplayed.

If the modification was done directly on the tree, the <variable> cannot
notify to listening tools (ctedits, menuMode) that something is changed.

You must either call {ctedit}:redraw followed by {ctedit}:expose (or
{ctedit}:incremental-redisplay), or build a modification path, set this
modification path to the <variable> and all tools will be updated.

Vincent