blessed-contrib
blessed-contrib copied to clipboard
Export examples/explorer as a requirable widget
Can you please elaborate a bit further? I am willing to take some of this on, but would like to understand your use case so I can figure out a few things like...
What sort of configuration options would you like to see available? What events do you want to be able to hook into? (just file selections, directories, up/down, etc) Does it need to be refreshable? Do things need to be marked as 'selected'?
Theoretically I would be using this in slap to replace the lightly customized but mostly default blessed.FileManager.
Amenable to discussion:
- Should hook into a
select
event where a row is clicked or Enter is pressed while one is focused -
file
anddirectory
events cool too - Ability to get current focused row
- Selecting a directory by clicking on it or pressing Enter should unfold the directory
- Maybe make this cancelable?
- Should be able to refresh an arbitrary level, only one level deep would be good enough
- Each row's display value from beginning to end should be editable, regardless of internal state
- Multiple selections would be great but not necessary
- Root should be selectable via API
cc @theredcat
Don't look complicated. The select event is already here and can be hooked to handle higher-levels events.
I may have a simple way to integrate this just by overloading the constructor of Tree
@dbkaplun would you like to have the file stats object as a event callback parameter? Or the path will be enough?
For the sake of performance, simply a path will be enough, but if you already get a Stats
object then it's nice to have.