-
Hi all! I'm currently working on a Textual app in which I'm hoping to display the "Upload" status of individual files in a user's local directory using a dynamically-styled DirectoryTree widget (see image below). My initial idea here was to somehow "select" individual nodes in my DirectoryTree based on their path names, and then apply additional styling using e.g. CSS classes. However, after having a reasonably thorough read through the docs, I'm no longer sure it will be so straightforward. Is it all possible to select and style individual nodes of a DirectoryTree in this way? If not, is there perhaps some other workaround I could consider using? I apologize if this is an obvious question - I'm relatively new to Textual and to software development in Python in general, so maybe I'm just missing something here! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Nodes in a |
Beta Was this translation helpful? Give feedback.
Nodes in a
Tree
aren't widgets, and so aren't part of the DOM, and as such can't be styled (directly) with CSS. Likely the best approach if you want custom highlighting is to inherit fromDirectoryTree
and extendrender_label
. SeeDirectoryTree.render_label
to see how it does the current styling.