polychron.presenters.PopupPresenter
Module
PopupPresenter
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
The MVP model object which includes the data to be presented and methods to manipulate it
__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 |
required |
view
|
ViewT
|
The popup 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
display_view
display_view() -> None
Make the view visible (and not minimised)
minimise_view
minimise_view() -> None
Minimise the view
hide_view
hide_view() -> None
Hide (withdraw) the view
close_view
close_view(event: Any = None) -> None
Close the popup after performing any actions.
This method should be overridden by presenters which require graceful destruction or wish to disable window closing.