class documentation

class ViewManager:

Constructor: ViewManager()

View In Hierarchy

Manage multiple views and provide navigation capabilities.

Method __del__ Destructor to clean up resources.
Method __init__ Initialize the ViewManager with default settings.
Method active.setter Set the active state of the ViewManager.
Method add Add a view to the manager.
Method alert Show an alert and wait for the user to acknowledge it.
Method back Navigate back to the previous view in the stack.
Method background_color.setter Set the background color.
Method clear Clear the screen with the background color.
Method clear_stack Clear the navigation stack.
Method foreground_color.setter Set the foreground color.
Method freq Set the CPU frequency.
Method get_view Get a view by name.
Method log Log a message with an optional log type.
Method push_view Push a view to the stack by name.
Method remove Remove a view by name.
Method run Run the current view.
Method selected_color.setter Set the selected color.
Method set Set the current view by name, clearing the stack.
Method switch_to Switch to a view by name with options for stack management.
Constant FREQ_DEFAULT Undocumented
Constant FREQ_PIMORONI Undocumented
Constant FREQ_RP2040 Undocumented
Constant FREQ_RP2350 Undocumented
Constant MAX_STACK_SIZE Undocumented
Constant MAX_VIEWS Undocumented
Class Variable __slots__ Undocumented
Instance Variable view_stack Undocumented
Instance Variable views Undocumented
Property active Return whether the ViewManager is active.
Property app_loader Return the shared AppLoader instance.
Property audio Return the Audio instance.
Property background_color Return the current background color.
Property battery Return the Battery instance.
Property board_id Return the current board ID.
Property board_name Return the current device name.
Property button Return the current button state.
Property current_view Return the current view.
Property draw Return the Draw instance.
Property foreground_color Return the current foreground color.
Property gmt_offset Return the GMT offset in hours.
Property has_audio Return whether the current board has audio capability.
Property has_bluetooth Return whether the current board has Bluetooth capability.
Property has_psram Return whether the current board has PSRAM.
Property has_sd_card Return whether the current board has an SD card.
Property has_wifi Return whether the current board has WiFi capability.
Property input_manager Return the Input manager instance.
Property keyboard Return the Keyboard instance.
Property logs Return the stored logs as a list of strings.
Property screen_size Return the screen size as a Vector.
Property selected_color Return the selected color.
Property storage Return the Storage instance.
Property thread_manager Return the ThreadManager instance.
Property time Return the Time instance.
Property usb_video_stream Return the USBVideoStream instance.
Property view_count Return the number of views managed.
Property wifi Return the WiFi instance.
Method _push_view Push a view onto the navigation stack.
Method _unload_unused_modules Unload view and gui modules no longer used (Flipper only).
Constant _CORE_MODULES Undocumented
Instance Variable _active Undocumented
Instance Variable _app_loader Undocumented
Instance Variable _audio Undocumented
Instance Variable _background_color Undocumented
Instance Variable _battery Undocumented
Instance Variable _button Undocumented
Instance Variable _current_board_id Undocumented
Instance Variable _current_view Undocumented
Instance Variable _draw Undocumented
Instance Variable _foreground_color Undocumented
Instance Variable _gmt_offset Undocumented
Instance Variable _input_manager Undocumented
Instance Variable _keyboard Undocumented
Instance Variable _log Undocumented
Instance Variable _selected_color Undocumented
Instance Variable _stack_depth Undocumented
Instance Variable _storage Undocumented
Instance Variable _thread_manager Undocumented
Instance Variable _time Undocumented
Instance Variable _usb_video_stream Undocumented
Instance Variable _view_count Undocumented
Instance Variable _wifi Undocumented
def __del__(self):

Destructor to clean up resources.

def __init__(self):

Initialize the ViewManager with default settings.

def active(self, value: bool):

Set the active state of the ViewManager.

Parameters
value:boolTrue to keep the manager running.
def add(self, view):

Add a view to the manager.

Parameters
view:ViewThe View object to add.
Returns
boolTrue if successfully added, False if max views reached.
def alert(self, message: str, back: bool = False) -> bool:

Show an alert and wait for the user to acknowledge it.

Parameters
message:strThe message to display in the alert.
back:boolWhether to navigate back after the alert is acknowledged. Defaults to False.
Returns
boolTrue if the user confirmed the alert, False otherwise.
def back(self, remove_current_view: bool = True, should_clear: bool = True, should_start: bool = True):

Navigate back to the previous view in the stack.

Parameters
remove_current_view:boolWhether to remove the current view from the manager. Defaults to True.
should_clear:boolWhether to clear the screen. Defaults to True.
should_start:boolWhether to start the previous view. Defaults to True.
def background_color(self, color):

Set the background color.

Parameters
color:intThe background color value.
def clear(self):

Clear the screen with the background color.

def clear_stack(self):

Clear the navigation stack.

def foreground_color(self, color):

Set the foreground color.

Parameters
color:intThe foreground color value.
def freq(self, use_default: bool = False, frequency: int = None) -> int:

Set the CPU frequency.

Parameters
use_default:boolWhether to use the default frequency. Defaults to False.
frequency:intExplicit frequency in Hz. Defaults to None.
Returns
intThe new CPU frequency.
def get_view(self, view_name: str):

Get a view by name.

Parameters
view_name:strThe name of the view to find.
Returns
ViewThe view object if found, None otherwise.
def log(self, message: str, log_type: int = -1) -> bool:

Log a message with an optional log type.

Parameters
message:strThe message to log.
log_type:intThe type of log. Defaults to -1.
Returns
boolTrue if the message was logged.
def push_view(self, view_name: str):

Push a view to the stack by name.

Parameters
view_name:strThe name of the view to push.
def remove(self, view_name: str):

Remove a view by name.

Parameters
view_name:strThe name of the view to remove.
def run(self) -> bool:

Run the current view.

def selected_color(self, color):

Set the selected color.

Parameters
color:intThe selected color value.
def set(self, view_name: str):

Set the current view by name, clearing the stack.

Parameters
view_name:strThe name of the view to set as current.
def switch_to(self, view_name: str, clear_stack=False, push_view=True):

Switch to a view by name with options for stack management.

Parameters
view_name:strThe name of the view to switch to.
clear_stack:boolWhether to clear the navigation stack. Defaults to False.
push_view:boolWhether to push the current view to the stack. Defaults to True.
FREQ_DEFAULT: int =

Undocumented

Value
200000000
FREQ_PIMORONI: int =

Undocumented

Value
210000000
FREQ_RP2040: int =

Undocumented

Value
200000000
FREQ_RP2350: int =

Undocumented

Value
240000000
MAX_STACK_SIZE: int =

Undocumented

Value
10
MAX_VIEWS: int =

Undocumented

Value
10
__slots__: tuple[str, ...] =

Undocumented

view_stack =

Undocumented

views =

Undocumented

@property
active =

Return whether the ViewManager is active.

@property
app_loader =

Return the shared AppLoader instance.

@property
audio =

Return the Audio instance.

@property
background_color =

Return the current background color.

@property
battery =

Return the Battery instance.

@property
board_id =

Return the current board ID.

@property
board_name =

Return the current device name.

@property
button =

Return the current button state.

@property
current_view =

Return the current view.

@property
draw =

Return the Draw instance.

@property
foreground_color =

Return the current foreground color.

@property
gmt_offset =

Return the GMT offset in hours.

@property
has_audio =

Return whether the current board has audio capability.

@property
has_bluetooth =

Return whether the current board has Bluetooth capability.

@property
has_psram =

Return whether the current board has PSRAM.

@property
has_sd_card =

Return whether the current board has an SD card.

@property
has_wifi =

Return whether the current board has WiFi capability.

@property
input_manager =

Return the Input manager instance.

@property
keyboard =

Return the Keyboard instance.

@property
logs: list =

Return the stored logs as a list of strings.

@property
screen_size =

Return the screen size as a Vector.

@property
selected_color =

Return the selected color.

@property
storage =

Return the Storage instance.

@property
thread_manager =

Return the ThreadManager instance.

@property
time =

Return the Time instance.

@property
usb_video_stream =

Return the USBVideoStream instance.

@property
view_count =

Return the number of views managed.

@property
wifi =

Return the WiFi instance.

def _push_view(self, view):

Push a view onto the navigation stack.

Parameters
view:ViewThe view to push.
def _unload_unused_modules(self):

Unload view and gui modules no longer used (Flipper only).

_CORE_MODULES: set[str] =

Undocumented

Value
set(['picoware.gui.draw',
     'picoware.gui.keyboard',
     'picoware.gui.alert',
     'picoware.gui.desktop'])
_active =

Undocumented

_app_loader =

Undocumented

_audio =

Undocumented

_background_color =

Undocumented

_battery =

Undocumented

_button: int =

Undocumented

_current_board_id =

Undocumented

_current_view =

Undocumented

_draw =

Undocumented

_foreground_color =

Undocumented

_gmt_offset =

Undocumented

_input_manager =

Undocumented

_keyboard =

Undocumented

_log =

Undocumented

_selected_color =

Undocumented

_stack_depth: int =

Undocumented

_storage =

Undocumented

_thread_manager =

Undocumented

_time =

Undocumented

_usb_video_stream =

Undocumented

_view_count: int =

Undocumented

_wifi =

Undocumented