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>sArg arglist[10];arglist[0].name = XtNwidth;arglist[0].value = (XtArgVal) 400;arglist[1].name = XtNheight;arglist[1].value = (XtArgVal) 300;Note that in this example, as in the previous example, XtNumber would return 10,not 2, and therefore would not be useful.The fourth approach is to use a mixture of the first and third approaches: you canstatically define the argument list but modify some entries at runtime. For example:static Arg arglist[] = {{XtNwidth, (XtArgVal) 400},{XtNheight, (XtArgVal) NULL},};arglist[1].value = (XtArgVal) 300;In this example, XtNumber can be used, as in the first approach, for easier codemaintenance.Example ProgramsThe best way to understand how to use any programming library is by trying somesimple examples. A collection of example programs that introduces each of the widgetsin that <strong>Athena</strong> widget set, as well as many important toolkit programming concepts,is available in the X11R5 contrib release as distributed by the X <strong>Consortium</strong>.It can be found in the directory contrib/examples/Xaw in the archive at http://www.x.org/releases/X11R5/contrib-1.tar.Z See the README file from that directoryfor a guide to the examples.20

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

Saved successfully!

Ooh no, something went wrong!