Args: title (str): The title of the dialog. message (str): The message description. initial_value (str): The default content for the TextInput field. kwargs: See Container.__init__()
(self, title='Title', message='Message', initial_value='', *args, **kwargs)
| 2539 | """ |
| 2540 | |
| 2541 | def __init__(self, title='Title', message='Message', initial_value='', *args, **kwargs): |
| 2542 | """ |
| 2543 | Args: |
| 2544 | title (str): The title of the dialog. |
| 2545 | message (str): The message description. |
| 2546 | initial_value (str): The default content for the TextInput field. |
| 2547 | kwargs: See Container.__init__() |
| 2548 | """ |
| 2549 | super(InputDialog, self).__init__(title, message, *args, **kwargs) |
| 2550 | |
| 2551 | self.inputText = TextInput() |
| 2552 | self.inputText.onkeydown.connect(self.on_keydown_listener) |
| 2553 | self.add_field('textinput', self.inputText) |
| 2554 | self.inputText.set_text(initial_value) |
| 2555 | |
| 2556 | self.confirm_dialog.connect(self.confirm_value) |
| 2557 | |
| 2558 | def on_keydown_listener(self, widget, value, keycode): |
| 2559 | """event called pressing on ENTER key. |