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.

Using <strong>Widget</strong>sapplication_classoptionsnum_optionsargc_in_outargv_in_outfallback_resourcesargsnum_argsSpecifies the class name of this application, whichis usually the generic name for all instances of thisapplication. A useful convention is to form the classname by capitalizing the first letter of the applicationname. For example, the application named ``xman''has a class name of ``Xman''.Specifies how to parse the command line for any application-specificresources. The options argument ispassed as a parameter to XrmParseCommand. For furtherinformation, see Xlib - C <strong>Language</strong> <strong>Interface</strong>.Specifies the number of entries in the options list.Specifies a pointer to the number of command lineparameters.Specifies the command line parameters.Specifies resource values to be used if the site-wideapplication class defaults file cannot be opened, orNULL.Specifies the argument list to use when creating theApplication shell.Specifies the number of arguments in args.This function will remove the command line arguments that the toolkit reads fromargc_in_out, and argv_in_out. It will then attempt to open the display. If the displaycannot be opened, an error message is issued and XtAppInitialize terminates theapplication. Once the display is opened, all resources are read from the locationsspecified by the Intrinsics. This function returns an ApplicationShell widget to beused as the root of the application's widget tree.Creating a <strong>Widget</strong>Creating a widget is a three-step process. First, the widget instance is allocated,and various instance-specific attributes are set by using XtCreate<strong>Widget</strong>. Second,the widget's parent is informed of the new child by using XtManageChild. Finally,X windows are created for the parent and all its children by using XtRealize<strong>Widget</strong>and specifying the top-most widget. The first two steps can be combined byusing XtCreateManaged<strong>Widget</strong>. In addition, XtRealize<strong>Widget</strong> is automaticallycalled when the child becomes managed if the parent is already realized.To allocate, initialize, and manage a widget, use XtCreateManaged<strong>Widget</strong> .<strong>Widget</strong> XtCreateManaged<strong>Widget</strong>( name, widget_class, parent, args,num_args);namewidget_classSpecifies the instance name for the created widgetthat is used for retrieving widget resources.Specifies the widget class pointer for the createdwidget.8

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

Saved successfully!

Ooh no, something went wrong!