Info Bricks » History » Version 1

Version 1/8 - Next ยป - Current version
Ohlsson, Staffan, 20/01/2012 08:20 AM


Overview of a Brick

A brick is a part of a GUI, generally used to display information about a piece of equipment, and/or allow the user to interact with it.


A Brick is a class inheriting from Framework4.GUI.Core.BaseBrick.

A Brick is connected to Control Objects when building a new application. Each Brick may define several connections. Each connection specifies which signals and slots the brick expects from the Control Object.

The definition is stored in the 'connections' variable in the brick class. It has the form:

connections = { 'connection_name': Connection([Signal('signal_name'), ...], [Slot('slot_name'), ...], 'status_function_name') }

The Connection, Signal and Slot classes are located in the Framework4.GUI.Core package.

The 'status_function_name' is a string. It is the name of one of the Brick's methods. This method will be called every time the connection is made or lost. It should have one argument (besides self), which will be set to the connection status (true: connected, false: disconnected).

The Brick must also have an init method, with no arguments. This method is called by the framework after the brick has been instantiated.

The Brick class may also have a 'properties' variable. TODO : describe this

Particularities when uning object groups

Commented Brick code example