polychron.presenters.FramePresenter
Module
FramePresenter
Bases: ABC
, Generic[ViewT, ModelT]
Abstract Base Class for Presenters for views which are in the main window, which act as the middle man between a veiw and the underlying data structures (model).
mediator
instance-attribute
mediator: Mediator = mediator
Reference to the parent mediator class, to enable switching between presenters/views
view
instance-attribute
view: ViewT = view
View managed by this presenter
model
instance-attribute
model: ModelT = model
Model objects which include data and buisness logic which are presented by this presenter/view
__init__
__init__(mediator: Mediator, view: ViewT, model: ModelT) -> None
Initialise the presenter
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mediator
|
Mediator
|
an object which implements the Mediator protocol, i.e. the MainApp |
required |
view
|
ViewT
|
The frame view instance to be presented |
required |
model
|
ModelT
|
The MVP model object which includes the data to be presented and methods to manipulate it |
required |
update_view
abstractmethod
update_view() -> None
Update view data for the current state of the model
get_window_title_suffix
get_window_title_suffix() -> str | None
Get a optional suffix for the window title, for this frame.
Returns:
Type | Description |
---|---|
str | None
|
Optional suffix for the window title when this frame is being displayed |