spec-framework / spec

The code of Spec for Pharo
MIT License
16 stars 6 forks source link

Can't configure a tree to auto refresh when a node is folded and then unfolded #11

Closed DamienCassou closed 10 years ago

DamienCassou commented 10 years ago

To reproduce, evaluate this

TreeModel new
    childrenBlock: [ :number | Halt now. 1 to: number ];
    hasChildrenBlock: [ :number | true ];
    roots: (1 to: 10);
    openWithSpec

and then:

  1. unfold node 10
  2. a debugger opens because of the Halt now
  3. close the debugger
  4. refold node 10
  5. unfold node 10
  6. the debugger is not reopened

This means that the #childrenBlock: is executed only once and then cached. In some scenarios, users will expect folding and then unfolding a node to refresh the node's children.

BenjaminVanRyseghem commented 10 years ago

I am waiting for your pull request ;)

BenjaminVanRyseghem commented 10 years ago

Fix by PR12