ScreenFlow

ScreenFlow class is the library entry point, which implements all the logic to manages event, handles screen creation, and so on.

Screen binding

Each screen belonging to your screenflow can be retrieved using attribute binding. Let say you added a screen with name foo in a given screenflow instance, such screen could be accessed as following :

screenflow.foo

XML loading

ScreenFlow allows you to define your screens by using XML format using following convention :

<?xml version="1.0"?>
<screenflow>
    <!-- Your screens here-->
</screenflow>

Where each screen is defined as following :

<screen name="screen_name" type="screen_type">
    <!-- Your screen specific parameter here -->
</screen>

The name attribute will be used for attribute binding. Checkout available screens documentation to know what parameter can be settled.

Custom screen

You can implements your own screen by extending the Screen base class. Although for screenflow to recognize your screen implementation when parsing an XML file, you should register a factory function.

Such factory function should match the following signature :

def my_factory(screen_def):
    my_screen = ... // Create your screen instance here.
    return my_screen

Where screen_def parameter is a dictionary from xmltodict parsing library. Then registering such function is as easy as following :

screenflow = ScreenFlow()
screenflow.register_factory('type_name', my_factory)