Skip to content

Async? #264

Answered by mharig
mharig asked this question in Q&A
Feb 5, 2022 · 2 comments
Discussion options

You must be logged in to vote

I found a more or less minimal solution, that does what I want:

import asyncio
from concurrent.futures import ThreadPoolExecutor
from rich.tree import Tree
from rich.panel import Panel

from textual.widget import Widget
from textual.app import App
from textual.widgets import ScrollView

from time import sleep

class MboxTree(Widget):

    def on_mount(self):
        self.mbTree = Tree('root')
        self.mbTree.hide_root = True
        self.nodes = []
        for c in ['a', 'b', 'c']:
            node = self.mbTree.add(c)
            self.nodes.append(node)

        self.panel = Panel(
                self.mbTree,
                title='Title',
                title_align='left'

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mharig
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants