Adds a field to the dialog with a unique identifier. Note: You can access to the fields content calling the function GenericDialog.get_field(key). Args: key (str): The unique identifier for the field. field (Widget): The widget to be added to the di
(self, key, field)
| 2480 | self.container.append(container, key=key) |
| 2481 | |
| 2482 | def add_field(self, key, field): |
| 2483 | """ |
| 2484 | Adds a field to the dialog with a unique identifier. |
| 2485 | |
| 2486 | Note: You can access to the fields content calling the function GenericDialog.get_field(key). |
| 2487 | |
| 2488 | Args: |
| 2489 | key (str): The unique identifier for the field. |
| 2490 | field (Widget): The widget to be added to the dialog, TextInput or any Widget for example. |
| 2491 | """ |
| 2492 | self.inputs[key] = field |
| 2493 | container = HBox() |
| 2494 | container.style.update({'justify-content': 'space-between', 'overflow': 'auto', 'padding': '3px'}) |
| 2495 | container.append(self.inputs[key], key=key) |
| 2496 | self.container.append(container, key=key) |
| 2497 | |
| 2498 | def get_field(self, key): |
| 2499 | """ |