User Tools

Site Tools


sample_code:layout_children

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sample_code:layout_children [2014/12/11 13:17]
84.181.41.137 [Layout Children]
sample_code:layout_children [2014/12/29 02:20] (current)
Line 42: Line 42:
   return children;    return children; 
  
 +</code>
 +===== clearLayout =====
 +<code JavaScript clearlayout.js>
 +function clearLayout(layt)
 +{
 +  //takes a layout as an argument 
 +  var allobjs = app.GetObjects();
 +  var obj, order; 
 +  //loop through all controls 
 +  for (var id in allobjs) 
 +  { 
 +      obj = allobjs[id] 
 +      //check if control is on our layout 
 +      order = layt.GetChildOrder( obj ); 
 +      if( order > -1 ) 
 +      { 
 +          //got one! 
 +          layt.DestroyChild( obj ); 
 +      } 
 +   }
 +
 </code> </code>
 ===== Sample app ===== ===== Sample app =====
sample_code/layout_children.1418303824.txt.gz · Last modified: 2014/12/11 21:17 (external edit)