Window_controller (controller.window_controller)¶
controller.window_controller
¶
Window controller managing GUI lifecycle, status messages, dialogs, and timer intervals.
WindowController
¶
Oversees GUI application window lifecycle, dialog alerts, and timer ticking.
Source code in src/controller/window_controller.py
__init__(game_controller=None, title='ChessWithQuests', dimensions=(800, 600))
¶
Initialize a WindowController instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game_controller
|
Optional[GameController]
|
Optional GameController instance. |
None
|
title
|
str
|
Window title string (default: "ChessWithQuests"). |
'ChessWithQuests'
|
dimensions
|
Tuple[int, int]
|
(width, height) pixel tuple (default: (800, 600)). |
(800, 600)
|
Source code in src/controller/window_controller.py
close_dialog()
¶
on_square_clicked(position)
¶
Dispatch square click to GameController and update UI status text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
Tuple[int, int]
|
(row, col) coordinates clicked. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dictionary result from GameController. |
Source code in src/controller/window_controller.py
set_status(message)
¶
Update window footer status message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Text message to display. |
required |
show_dialog(message)
¶
Trigger an active popup dialog with a message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Dialog body text. |
required |
start()
¶
stop()
¶
tick_timer()
¶
Advance timer tick by one second for active player and update status if expired.