Group Object Class


Overview

Group is a special object class that can be used to group multiple graphic objects into a single object. Since groups are graphic objects, nested groups can be created.

The Group class is also used as the base class for more complex object classes such as Chart or Plot2D.


Interactive Grouping

The EditObject class defines two convenience functions to manipulate groups. Function XintEditObjectGroup automatically creates a group from the selected objects in the display. Function XintEditObjectUngroup ungroups the objects from the selected group object and destroys the empty group object. See the EditObject Widget reference section for more information on those two functions.

Example

The following code fragment illustrates how to create a group from a text and a line object.

   Widget edit; /* The parent EditObject widget */
   XintTextLocation text_location;
   XintLine line_location;
   Object group;
   ...
   /* Create the group */
   group = (Object) XtVaCreateWidget("group",
                                     (WidgetClass)xintGroupObjectClass, 
                                     edit,
                                     XmNlist, list,
                                     XmNlistCount, 2,
                                     NULL);
   
   /* create an Text object and insert in the group */
   text_location.x = 50;
   text_location.y = 50;
   XtVaCreateWidget("text", (WidgetClass)xintTextObjectClass, edit,
                    XmNgroup, group,
                    XmNtextLocation, &text_location,
                    XmNtextAnchor, XintBOTTOM_RIGHT,
                    XmNtextString, "Something there?",
                    XmNfontSize, 12,
                    XmNroundEdge, True,
                    XmNfillStyle, XintFILL_SOLID,
                    XmNlineStyle, XintLINE_SOLID, 
                    NULL);
   
   /* Create line object and insert it in the group */
   line_location.start_x = 50;
   line_location.start_y = 50;
   line_location.end_x = 70;
   line_location.end_y = 70;
   XtVaCreateWidget("line", (WidgetClass)xintLineObjectClass, edit,
                    XmNgroup, group,
                    XmNline, &line_location,
                    XmNlineThickness, 2,
                    XmNlineEnd, XintEND_ARROW,
                    NULL);
   ...


Inherited Behavior and Resources

The Group object class inherits behavior and resources from the Xt Object and Graphic classes.
The following resources are defined by the Group object class.
NameTypeDefaultAccess
XmNlistObject *NULLCSG
XmNlistCountint0CSG
XmNpropagateBooleanFalseS


XmNlist

Specifies the list of objects in the group.

XmNlistCount

Specifies the size of the object list defined using resource XmNlist.

XmNpropagate

Specifies whether resources in a XtSetValues call are propagated to the objects in the group. After it is used, this resource is always reset to False.

Group Functions

Function XintCreateGroup creates a Group object.

     Object XintCreateGroup (...)

WidgetparentParent of new Group object.
char *nameName of new Group object.
ArgListarglistList of resource/value items.
CardinalargcountNumber of items in arglist.

Macros

Macro XintIsGroup returns True if the specified object is a Group object.

     Boolean XintIsGroup (Object object)