navigate.view.custom_widgets.LabelInputWidgetFactory.WidgetInputAdapter
- class navigate.view.custom_widgets.LabelInputWidgetFactory.WidgetInputAdapter(widget, variable=None, label=None)
Bases:
objectExpose a standalone widget through the same accessors as
LabelInput.This is useful when the parent container owns the grid layout directly and a nested
LabelInputframe would disrupt column alignment.- Parameters:
widget (tk.Widget) – Widget to expose through the adapter.
variable (Any, optional) – Tk variable bound to the widget, by default None.
label (ttk.Label, optional) – Optional external label paired with the widget, by default None.
- __init__(widget, variable=None, label=None)
Initialize the widget adapter.
Methods
__init__(widget[, variable, label])Initialize the widget adapter.
get([default])Return the current widget value.
Return the Tk variable associated with the widget.
set(value, *args, **kwargs)Set the widget value through the bound variable when possible.
- get(default=None)
Return the current widget value.
- get_variable()
Return the Tk variable associated with the widget.
- set(value, *args: Any, **kwargs: Any)
Set the widget value through the bound variable when possible.