search_game_page module¶
A module with a game search page class, as well as a circular search indicator class and a timer class.
- class search_game_page.CircularWaitingIndicator(parent: search_game_page.SearchGamePage, width: int = 80, height: int = 80, color: str = 'blue', thickness: int = 5, speed: int = 5)¶
Bases:
tkinter.CanvasThe class of the circular game search indicator.
- Parameters
parent (class: SearchGamePage) – Object of the SearchGamePage class
width (class: int) – Width of the circular game search indicator, defaults to 80
height (class: int) – Height of the circular game search indicator, defaults to 80
color (class: str) – Color of the circular game search indicator, defaults to “blue”
thickness (class: int) – Thickness of the circular game search indicator, defaults to 5
speed (class: int) – Speed of the circular game search indicator, defaults to 5
- __init__(parent: search_game_page.SearchGamePage, width: int = 80, height: int = 80, color: str = 'blue', thickness: int = 5, speed: int = 5) None¶
Make constructor method.
- update_animation() None¶
Make the circular game search indicator spin.
- class search_game_page.SearchGamePage(master)¶
Bases:
tkinter.FrameThe class of the game search page.
- Parameters
master (class: tictactoe.App) – An instance of the main class of the game application
- __init__(master) None¶
Make constructor method.
- _create_widgets() None¶
Render widgets of the game search page.
- change_language(lang: str) None¶
Set action for the language change button.
- Parameters
lang (class: str) – A string with the localization language of the application, “en” or “ru”
- game_ready(data: Dict[str, str]) None¶
Trigger when a game is found and switches the interface to the game page.
- Parameters
data (class: dict[str, str]) – Dictionary with game data
- is_searched() None¶
Ask the server_dir in a separate thread every 5 seconds if the game has been found.
- reset_search() None¶
Set action for the “Reset search” button.
- class search_game_page.TimeCounter(parent: search_game_page.SearchGamePage, font: tkinter.font.Font, *args, **kwargs)¶
Bases:
tkinter.LabelThe timer class.
- Parameters
parent (class: SearchGamePage) – Object of the SearchGamePage class
font (class: tkinter.font.Font) – The font style for the timer
*args –
Positional arguments
**kwargs –
Named arguments
- __init__(parent: search_game_page.SearchGamePage, font: tkinter.font.Font, *args, **kwargs) None¶
Make constructor method.
- run() None¶
Update the time on the timer every second.
- start() None¶
Start the timer.
- update_text() None¶
Update the text on a widget with a timer.