Files
TempleOS-Rijn/LT/DEMO/TreeDemo.CPZ
T
2018-09-08 21:45:17 +02:00

34 lines
968 B
Plaintext

/*
This uses LtfPutS/LtfPrintF because updates
to within a tree while a tree is collapsed get
messed-up if "live"(like using ordinary PrintF/PutS.)
The insert point is confused by hiding of
data in collapsed trees. Therefore, the window main
Ltf is taken off-line by disabling preemption so there
are no screen updates until all data has been inserted.
There is a special Ltf function which is also
available to take an Ltf off-line. See $LK,"LtfSafeInsert","MN:LtfSafeInsert"$.
For this example, however, I wanted to use LtfPrintF
and disabled Preemption myself.
*/
#include "/LT/DEMO/TreeDemoJoin"
void TreeDemo()
{
FlagsStruct f;
U4 old_preempt;
Ltf *l=Fs->cur_ltf;
GetFFlags(&f,"ST_FILE_UTIL_FLAGS","+r");
old_preempt=Preempt(OFF);
LtfPutS(l,"$$TR -C+AL,\"\"$$\r\n");
LtfPutS(l,"$$ID,+2$$");
TreeSub(l,FindFiles("/LT/*",&f.on));
LtfPutS(l,"$$ID,-2$$");
LtfRecalc(l);
Preempt(old_preempt);
}
TreeDemo;