Next Previous Contents

3. The TinyWidgets API

3.1 tnAppInitialize


TN_WIDGET * tnAppInitialize(int argc, char *argv[])

Initializes various parameters of the internal state machine for Tiny Widgets and calls GrOpen to open a socket to Nano-X. It returns a pointer to TN_WIDGET which is supposed to be the main widget (actually the root window) and should be used as parent to the main window widget that will be created. Takes command line parameters.

3.2 tnCreateWidget


TN_WIDGET * tnCreateWidget(TN_WIDGET_TYPE type, 
                           TN_WIDGET   *parent, int posx, int posy,...)

Creates a widget specified by the type arguement and places it at position specified by posx, posy, relative to the parent widget specified by the parent arguement. The various types of widgets that can be created are: There are various optional arguements that can be specified for every widget. The optional arguements have to be specified as a pair of values, the first specifying the type of arguement and the second the value. The various types of arguments that can be specified are: (Besides the above, each widget has certain widget specific properties. For these, please refer to the specific documentation for each widget).

3.3 tnMainLoop


void tnMainLoop(void)

This call invokes the main event processing loop for the application. This call will never return. Event processing will not begin until this function is invoked.

3.4 tnEndApp


void tnEndApp(void) 

This call causes the application to terminate and the connection to the server to be closed.
Next Previous Contents