/* This uses LtfPutSExt/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() { U8 f=0; BoolU4 old_preempt; Ltf *l=Fs->cur_ltf; GetFFlags(&f,SysText("ST_FILE_UTIL_FLAGS"),"+r"); old_preempt=Preempt(OFF); LtfPutSExt(l,"$$TR-C+AL,\"\"$$\r\n"); LtfPutSExt(l,"$$ID,+2$$"); TreeSub(l,FindFiles("/LT/*",f)); LtfPutSExt(l,"$$ID,-2$$"); LtfRecalc(l); Preempt(old_preempt); } TreeDemo;