12.07.2015 Views

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Composite and Constraint<strong>Widget</strong>sSpecial ConsiderationsThe Dialog widget automatically sets the top and bottom resources for all Childrenthat are subclasses of the Command widget, as well as the widget children that areused to contain the label, value, and icon. This policy allows the buttons at thebottom of the Dialog to interact correctly with the predefined children, and makesit possible for a client to simply create and manage a new Command button withouthaving to specify its constraints.The Dialog will also set fromLeft to the last button in the Dialog for each new buttonadded to the Dialog widget.The automatically added constraints cannot be overridden, as they are policy decisionsof the Dialog widget. If a more flexible Dialog is desired, the application isfree to use the Form widget to create its own Dialog policy.Automatically Created Children.The Dialog uses Label widgets to contain the label and icon. These widgets arenamed label and icon respectively. The Dialog value is contained in an AsciiTextwidget whose name is value. Using XtNameTo<strong>Widget</strong> the application can changethose resources associated with each of these widgets that are not available throughthe Dialog widget itself.Convenience RoutinesTo return the character string in the text field, useString XawDialogGetValueString( w);wSpecifies the Dialog widget.This function returns a copy of the value string of the Dialog widget. This string isallocated by the AsciiText widget and will remain valid and unchanged until anothercall to XawDialogGetValueString or an XtGetValues call on the value widget,when the string will be automatically freed, and a new string is returned. This stringmay be freed earlier by calling the function XawAsciiSourceFreeString.To add a new button to the Dialog widget use XawDialogAddButton.void XawDialogAddButton( w, name, func, client_data);wnamefuncclient_dataSpecifies the Dialog widget.Specifies the name of the new Command button to beadded to the Dialog.Specifies a callback function to be called when thisbutton is activated. If NULL is specified then no callbackis added.Specifies the client_data to be passed to the func.This function is merely a shorthand for the code sequence:107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!