Creating a GUI Element Add-on


Warning! The Add-on API will change soon!

Converting old add-ons to the new format will be relatively easy.


The minimum requirement for a GUI element add-on is that it should be capable of

For more convenient usage the add-on should be capable of handling a variable or structure: If the add-on will generate source, it may implement: The add-on can also contain an inspector. The inspector allows you to edit the parameters of the view instance interactively. In this case the add-on should implement: This was a long list but writing an add-on is not a big deal. Please check out the examples (BButton and BCheckBox, downloadable from the IE homepage).

The header files

There is only one header file (IEElement.h) which you have to include in your project and which you can find in the Develop directory.


Exported functions

There is only one function an add-on should export as extern "C":


void *message_port(BMessage *message);

This function is the interface between the add-on and Interface Elements (or the ResourceHandler). The meaning of the return value depends on the message the add-on receives; sometimes there is no return value (can be NULL), or it is a BWindow* or a BMessage*. The main application will know what to expect.


The messages an add-on can receive in message_port()

All messages arrive through the exported message_port function as an argument.


The messages an add-on can receive in MessageReceived() of the view

These messages arrive in the MessageReceived() method of the add-on's BView derived class. So if you need to implement controlling a variable or an action when all the views are attached to the window, you should override MessageReceived().


The messages an add-on can send

All messages are sent with the BMessenger that the add-on receives in the 'Edit' message.