[Gambas-user] Columnview "collapse" function
    adamnt42 at ...626... 
    adamnt42 at ...626...
       
    Thu Nov 10 04:38:27 CET 2016
    
    
  
What in the name of American erections am I doing wrong here?
Public Sub mnuCollapse_Click()
  ' Collapse all nodes to the level of the selected node
  Dim hNode As CNode
  Dim hAttr As String
  Dim iLevel As Integer
  
  hNode = $hDoc.Index[tvwDoc.Key]
  iLevel = hNode.Level
START_HERE:  
  tvwDoc.MoveFirst
  While tvwDoc.MoveNext()   
    hNode = $hDoc.Index[tvwDoc.Item.Key]  '<-- All "seems" to fall apart here?
    If hNode.Level >= iLevel Then 
      tvwDoc.Item.Expanded = False
    Endif
  Wend
End
tvwDoc is a ColumnView. There is a selected item in the _TreeView, Thus, tvwDoc.Key provides a key into the $hDoc.Index collection from which I can determine the object that was used to populate that columnView branch and from that objects values I can see the "Level" that I want. All that works fine.
What I am trying to do is go through the ColumnView branches and "collapse" any branch of the same "Level".  Which gets us to START_HERE.
There must be something absolutely, stupidly, simple that I am trying to do wrong here - :-( 
Any help.
rgrds
b
-- 
B Bruen <adamnt42 at ...3379... (sort of)>
    
    
More information about the User
mailing list