Next: , Up: The Command Structure



7.3.1 The Context

The context is a collection of several things in the GUI which are currently significant: the current window, the last used object, the group containing the last used objects, the parent document and tlo of the group. It also stores the current selection bitmasks and selected GO counts for meta selection and for selection inside the context group (counts of selected GOs per each GO type).

The context affects mainly the behaviour of the menus and toolbars – its contents define which commands can or can not be activated. But it is used for other purposes as well; for example, many user messages are written into the status bar of the context window.

The context can be changed only using the following function:

     void change_context( struct window * window, struct go_group * group,
                          struct o * o );

These three arguments determine all the other contents of the context. After a context change, some internal GUI callbacks are called, like those of the Context Property Window. Any of the context object pointers can be NULL as well. A pointer may become NULL, for example, when the original object is unlinked or the window is closed. The selection bitmasks and counts are updated after each selection change or context group change.