-
Notifications
You must be signed in to change notification settings - Fork 733
Showing a simple message dialog in fullscreen apps - possible with simple code? #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I also look to fix this one:
|
Hi @rolfschr, Unfortunately, there is not really a shortcut to achieve this. You can have a from prompt_toolkit.layout import FloatContainer, Float
from prompt_toolkit.widgets import Dialog, Label, Button
def button_handler():
pass
dialog = Dialog(
title=title,
body=Label(text="YOUR_TEXT", dont_extend_height=True),
buttons=[
Button(text="BUTTON_TEXT", handler=button_handler),
])
floatcontainer.floats.append(
Float(content=dialog), # optionally pass width and height.
) |
Hi, thanks a lot. I was able to get the dialog as you described. Some hints that helped me:
|
Hi,
I would like to show a message dialog in a full screen application but I can't find anything about this in the docs. I have seen what I want in
examples/fullscreen/text-editor.py
, specifically the 'About' dialog (I simply need something to confirm). The example contains a lot of code in order to get the dialog box appear and I was hoping to find something more simple like one or two function calls. Is that possible?I thought
message_dialog
would do, but it doesn't due to the 'event loop is already running' exception (similar to #652).The text was updated successfully, but these errors were encountered: