textual icon indicating copy to clipboard operation
textual copied to clipboard

TreeControl in ScrollView can not scroll horizontally

Open jason-ni opened this issue 3 years ago • 0 comments

Thank you guys for this great project! It's amazing!

I'm expecting a TreeControl can be scrolled horizontally as more nodes added. Anything I was missing in below demo code? Using Python 3.9 and textual 0.1.18.

from textual import events
from textual.app import App
from textual.widgets import TreeControl, TreeClick, ScrollView


class TreeApp(App):

    async def on_mount(self, event: events.Mount) -> None:
        self.sv = ScrollView(TreeControl("Tree Root", data="foo"))
        await self.view.dock(self.sv, edge="left", size=20)

    async def handle_tree_click(self, message: TreeClick) -> None:
        await message.node.add("foo", "")
        await message.node.expand()

TreeApp.run(log="textual.log")

jason-ni avatar Aug 19 '22 09:08 jason-ni