Closed johanfforsberg closed 9 years ago
I must admit the contents of urwid.ListBox
are complete voodoo to me.
I do not see any such invocation in ListBox.set_focus
.
Could it be that we should use connect_signal
here?
Hm, it is used by SimpleListWalker in the set_focus() method, but not by SimpleFocusListWalker which instead relies on MonitoredFocusList which has some magic to keep track of the focus, AFAICT. Probably simplest to just use _modified() in this case..?
OTOH, how does the tre handle focus if the list of siblings changes "underfoot"? Perhaps the MonitoredFocusList is needed anyway...
there is no smart handling of the focus in TreeBox
when you manipulate the underlying Tree
.
Since I don't know better I'm relying on wardi judgement here, who say'd this patch is safe and reasonable. thanks
Great!
I noticed that a focused node that is removed sticks around after refresh(). But I don't really see how this could be handled in a way that will always work, e.g. what to do with focus if a node is renamed; how could the tree know? So it's probably better to leave all this handling to the user and keep things simple.
BTW, thanks for this library, it made my tree code a lot simpler.
I believe this is consistent with how the urwid ListWalker works. Is there another way to get notified about focus changes?