Replies: 4 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
I was looking for a similar thing. I ended up using a non-blocking input reader and display every char in a panel as I press them. You could do a similar thing and based on input trigger functions if the input is a command. I used getch from getchlib which can get input in non-block mode: This is a snippet: with Live(layout, refresh_per_second=10, transient=True, screen=True):
while True:
get_ch(text)
pass
``
get_ch:
```py
text = Text('')
def get_ch(text: Text) -> Text:
while True:
ch:str = getchlib.getkey(False, echo=False)
if ch.isprintable():
text.append(ch)
elif ch == '\x7f':
# If backspace, crop last ch
text.right_crop()
elif ch == '\n':
# Do nothing right now
pass using layout: layout = make_layout()
layout['header'].update(Header())
layout['chat'].update(make_chat_panel())
layout['userlist'].update(make_userlist_panel())
layout['footer'].update(Panel(Align.left(text, vertical='top'), box=box.ROUNDED, title_align='left', title='Input:')) the input is done in shown and updated in layout['footer'] Hope it helps |
Beta Was this translation helpful? Give feedback.
-
Similar to #1641. |
Beta Was this translation helpful? Give feedback.
-
@zuhataslan I am trying to achieve a similar behaviour but having a hard time. If I use a renderable timestamp on one of the Panels, using your pattern above I see that it doesn't update properly and looks like it's blocking. Is there a chance you can share a more comprehensive gist in case I am missing something? |
Beta Was this translation helpful? Give feedback.
-
I have a dashboard, that roughly looks like this:
I use it with Live Display to continuosly update some scraped data, using Panels and all of the other renderables of course.
I was wondering if it was possible to ask for prompt/input during a Live display.
Thank you in advance!
EDIT: apparently it is not possible (yet)! Checked with previous questions! Sorry!
Beta Was this translation helpful? Give feedback.
All reactions