Athena Widget Set — C Language InterfaceXWindowSystemXVersion 11, Release 7libXaw 1.0.7Chris D. Petersonformerly MIT X Consortium
Athena Widget Set libXaw 1.0.7Chapter 2Using WidgetsWidgets serveasthe primary tools for building a user interface or application environment. TheAthe
Athena Widget Set libXaw 1.0.7TextSink This object is responsible for displaying and clearing the drawing area. It alsoreports the configuration of the
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default ValuedisplayCaret Output Boolean TruedisplayPosition TextPosition XawTextPosition 0height
Athena Widget Set libXaw 1.0.7topMargin The amount of space, in pixels, between the edge of the windowand thecorresponding edge of the text within the
Athena Widget Set libXaw 1.0.7the current window. The scrollbar will disappear when the text onceagain fits within the window.selectTypes Specifies the
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default ValueeditType EditType EditMode NULLdestroyCallback All functions on this list are called
Athena Widget Set libXaw 1.0.7w Specifies the TextSrc object.start Specifies the position of the first character to be removedfrom the text buffer.This i
Athena Widget Set libXaw 1.0.7position Specifies the position to begin the search.dir Specifies the direction to search, may be either XawsdLeft to sear
Athena Widget Set libXaw 1.0.75.11. TextSink ObjectApplication Header file <X11/Xaw/TextSink.h>Class Header file <X11/Xaw/TextSinkP.h>Class
Athena Widget Set libXaw 1.0.7void DisplayText(w, x, y, pos1, pos2, highlight)Widget w;Position x, y;XawTextPosition pos1, pos2;Boolean highlight;w Sp
Athena Widget Set libXaw 1.0.75.11.2.4. Finding aText Position GivenPixel ValuesTo find the text character position that will be rendered at a givenxlo
Athena Widget Set libXaw 1.0.7app_con_return Returns the application context of this application, if non-NULL.application_class Specifies the class nam
Athena Widget Set libXaw 1.0.75.11.2.5. Finding the Distance Between twoText PositionsTo find the distance in pixels between twotextpositions on the sa
Athena Widget Set libXaw 1.0.7void SetTabs(w, tab_count, tabs)Widget w;int tab_count, *tabs;w Specifies the TextSink object.tab_count Specifies the numb
Athena Widget Set libXaw 1.0.7Chapter 6Composite and Constraint WidgetsThese widgets may contain arbitrary widget children. Theyimplement a policyfor
Athena Widget Set libXaw 1.0.7The Box widget provides geometry management of arbitrary widgets in a box of a specifieddimension. The children are rearr
Athena Widget Set libXaw 1.0.7borderWidth The width of this widget’swindowborder.children A list of all this composite widget’scurrent children.colorm
Athena Widget Set libXaw 1.0.7Class dialogWidgetClassClass Name DialogSuperclass FormThe Dialog widget implements a commonly used interaction semantic
Athena Widget Set libXaw 1.0.7be used instead of the background color.borderColor A pixel value which indexesthe widget’scolormap to derive the border
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default ValuevertDistance Thickness int defaultDistance resourcebottomleftrighttop What to do with
Athena Widget Set libXaw 1.0.76.2.3.1. ExampleIf you wish to force the Dialog to neverresize one or more of its children then set left and rightto Xaw
Athena Widget Set libXaw 1.0.7Widget button = XtCreateManagedWidget(name, commandWidgetClass, w,NULL, ZERO);XtAddCallback(button, XtNcallback, func, c
Athena Widget Set libXaw 1.0.7Forfurther information, see XToolkit Intrinsics — C Language Interface.2.4. Common ResourcesAlthough a widget can have u
Athena Widget Set libXaw 1.0.7accelerators A list of event to action bindings to be executed by this widget, eventhough the event occurred in another
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default Valueresizable Boolean Boolean FALSEright Edge XawEdgeType XawRubbertop Edge XawEdgeType X
Athena Widget Set libXaw 1.0.7Edge Type Resource Name DescriptionXawChainTop ChainTop Edge remains a fixed distance from top of FormXawRubber Rubber Ed
Athena Widget Set libXaw 1.0.7The default bindings for the Paned widget’sgrips are:Mouse button Pane to Resize - Vertical Pane to Resize - Horizontal1
Athena Widget Set libXaw 1.0.7not be changed with XtSetValues,although it may be queried.background A pixel value which indexesthe widget’scolormap to
Athena Widget Set libXaw 1.0.7lowerCursorupperCursor The cursor used to indicate which is the important pane to resize whenthe Paned widget is oriente
Athena Widget Set libXaw 1.0.7showGrip If True then a grip will be shown for this pane. The grip associated withapane is either belowortothe right of
Athena Widget Set libXaw 1.0.76.4.4.4. Special ConsiderationsWhen a user resizes a pane with the grips, the Paned widget assumes that this newsize is
Athena Widget Set libXaw 1.0.7w Specifies the child pane.min Specifies the newminimum height of the child, expressed in pixels.max Specifies newmaximum h
Athena Widget Set libXaw 1.0.76.5.1. ResourcesWhen creating a Porthole widget instance, the following resources are retrievedfrom the argu-ment list o
Athena Widget Set libXaw 1.0.72.5.1. Cursor ConversionThe value for the cursorName resource is specified in the resource database as a string, and is o
Athena Widget Set libXaw 1.0.7mappedWhenManaged If this resource is True,then the widget’swindowwill automatically bemapped by the Toolkit when it is
Athena Widget Set libXaw 1.0.76.6.1. ResourcesWhen creating a Tree widget instance, the following resources are retrievedfrom the argumentlist or from
Athena Widget Set libXaw 1.0.7gravity Specifies the side of the widget from which the tree should grow. Validvalues include WestGravity, NorthGravity,
Athena Widget Set libXaw 1.0.7void XawTreeForceLayout(w)Widget w;w Specifies the Tree widget.6.7. Viewport WidgetApplication Header file <X11/Xaw/Vie
Athena Widget Set libXaw 1.0.7accelerators A list of event to action bindings to be executed by this widget, eventhough the event occurred in another
Athena Widget Set libXaw 1.0.7xyThe location of the upper left outside corner of this widget in its parent.6.7.2. Layout SemanticsThe Viewport widget
Athena Widget Set libXaw 1.0.7Chapter 7Creating New Widgets (Subclassing)Written By: Ralph SwickAlthough the task of creating a newwidget may at first
Athena Widget Set libXaw 1.0.7here. Section 1.4 of the Intrinsics should be read in conjunction with this section.All Athena widgets have three separa
Athena Widget Set libXaw 1.0.7#define XtCTemplateResource "TemplateResource"/* declare specific TemplateWidget class and instance datatypes */
Athena Widget Set libXaw 1.0.7#include <X11/Xaw/Template.h>/* include superclass private header file */#include <X11/CoreP.h>/* define uniqu
Athena Widget Set libXaw 1.0.72.7. Processing EventsNowthat the application has created, managed and realized its widgets, it is ready to process thee
Athena Widget Set libXaw 1.0.7#include <X11/IntrinsicP.h>#include <X11/StringDefs.h>#include "TemplateP.h"static XtResource reso
Athena Widget Set libXaw 1.0.7The resource list for the ‘‘WindowWidget’’might look likethe following:static XtResource resources[] = {#define offset(fie
Athena Widget Set libXaw 1.0.7/* expose */ Redisplay,The ‘‘WindowWidget’’will also declare three public procedures to return the drawing colors andthe
Table of ContentsAcknowledgments ...
Te x tSink Object ... 103Chapter 6 - Compos
Athena Widget Set libXaw 1.0.7void XtManageChildren(children, num_children)WidgetList children;Cardinal num_children;children Specifies a list of child
Athena Widget Set libXaw 1.0.7The arguments and values that are passed will depend on the widget being modified. Some wid-gets may not allowcertain res
Athena Widget Set libXaw 1.0.7void XtAddCallback(w, callback_name,callback, client_data)Widget w;String callback_name;XtCallbackProc callback;XtPointe
Athena Widget Set libXaw 1.0.7Forinformation about this function, see the XToolkit Intrinsics — C Language Interface.9. Link your application with lib
Athena Widget Set libXaw 1.0.7of applications named xman. (Note that while typically twowidgets thatare siblings will have different names, it is not
XWindowSystem is a trademark of The Open Group.Copyright © 1985, 1986, 1987, 1988, 1989, 1991, 1994 X ConsortiumPermission is hereby granted, free of
Athena Widget Set libXaw 1.0.72.10.2.2. Creating Argument ListsTo set up an argument list for the inline specification of widget attributes, you may us
Athena Widget Set libXaw 1.0.7Note that in this example, as in the previous example, XtNumber would return 10, not 2, andtherefore would not be useful
Athena Widget Set libXaw 1.0.7Chapter 3Simple WidgetsEach of these widgets performs a specific user interface function. Theyare simple because theycann
Athena Widget Set libXaw 1.0.73.1.1. ResourcesWhen creating a Command widget instance, the following resources are retrievedfrom the argu-ment list or
Athena Widget Set libXaw 1.0.7be used instead of the background color.bitmap A bitmap to display instead of the label.The default size of the widgetwi
Athena Widget Set libXaw 1.0.7international This is a boolean flag, only settable at widget creation time. Avalue offalse signals the widget to use pre
Athena Widget Set libXaw 1.0.73.1.2. Command ActionsThe Command widget supports the following actions:•Switching the button’sinterior between the fore
Athena Widget Set libXaw 1.0.7The Grip widget provides a small rectangular region in which user input events (such as Button-Press or ButtonRelease) m
Athena Widget Set libXaw 1.0.7borderWidth The width of this widget’swindowborder.callback All routines on this list are called wheneverthe GripAction
Athena Widget Set libXaw 1.0.7XEvent *event;String *params;Cardinal num_params;}XawGripCallDataRec, *XawGripCallData,GripCallDataRec, *GripCallData; /
AcknowledgmentsManythanks go to Ralph Swick (Project Athena / Digital) who has contributed much time andeffort to this widget set. Previous versions o
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default ValuedestroyCallback Callback XtCallbackList NULLencoding Encoding UnsignedChar XawTextEnc
Athena Widget Set libXaw 1.0.7cursorName The name of the symbol to use to represent the pointer cursor.Thisresource will override the cursor resource
Athena Widget Set libXaw 1.0.7resize Specifies whether the widget should attempt to resize to its preferreddimensions wheneverits resources are modified
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default ValueinsensitiveBorder Insensitive Pixmap GreyPixmapinternalHeight Height Dimension 2inter
Athena Widget Set libXaw 1.0.7defaultColumns The default number of columns. This value is used when neither thewidth nor the height of the List widget
Athena Widget Set libXaw 1.0.7screen The screen on which this widget is displayed. This is not a settableresource.sensitive Whether or not the toolkit
Athena Widget Set libXaw 1.0.7void XawListChange(w, list, nitems, longest, resize)Widget w;String * list;int nitems, longest;Boolean resize;w Specifies
Athena Widget Set libXaw 1.0.73.4.8. RestrictionsManyprogrammers create a ‘‘scrolled list’’byputting a List widget with manyentries as a childof a Vie
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default Valueinternational International Boolean C FalselineWidth LineWidth Dimension 0mappedWhenM
Athena Widget Set libXaw 1.0.7defaultScale The percentage size that the Panner widget should have relative tothesize of the canvas.depth The depth of
The R6 edition of this document has been edited to reflect changes brought about by researchstaffofthe Omron Corporation, with special recognition to L
Athena Widget Set libXaw 1.0.73.5.2. Panner ActionsThe actions supported by the Panner widget are:start() This action begins movement of the slider.st
Athena Widget Set libXaw 1.0.73.6. Repeater WidgetApplication header file <X11/Xaw/Repeater.h>Class header file <X11/Xaw/RepeaterP.h>Class r
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default Valueresize Resize Boolean Truescreen Screen Pointer R Parent’sScreensensitive Sensitive B
Athena Widget Set libXaw 1.0.7interval has reached minimumDelay milliseconds.depth The depth of this widget’swindow.destroyCallback All functions on t
Athena Widget Set libXaw 1.0.7minimumDelay The minimum time between callbacks in milliseconds.pointerColor A pixel value which indexesthe widget’scolo
Athena Widget Set libXaw 1.0.7<Btn1Up>: stop( )unset( )3.7. Scrollbar WidgetApplication header file <X11/Xaw/Scrollbar.h>Class header file &
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default Valueheight Height Dimension A depends on orientationinsensitiveBorder Insensitive Pixmap
Athena Widget Set libXaw 1.0.72.4.1)depth The depth of this widget’swindow.destroyCallback All functions on this list are called when this widget is d
Athena Widget Set libXaw 1.0.7thumb This pixmap is used to tile (or stipple) the thumb of the scrollbar.Ifnotiling is desired, then set this resource
Athena Widget Set libXaw 1.0.7void ScrollProc(scrollbar, client_data, position)Widget scrollbar;XtPointer client_data;XtPointer position;/*int */scrol
Chapter 1Athena Widgets and The IntrinsicsThe X Toolkit is made up of twodistinct pieces, the Xt Intrinsics and a widget set. The Athenawidget set is
Athena Widget Set libXaw 1.0.73.7.5. Setting Float ResourcesThe shown and topOfThumb resources are of type float.These resources can be difficult to get
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default Valuedepth Depth int C Parent’sDepthdestroyCallback Callback XtCallbackList NULLheight Hei
Athena Widget Set libXaw 1.0.7mappedWhenManaged If this resource is True,then the widget’swindowwill automatically bemapped by the Toolkit when it is
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default ValueinsensitiveBorder Insensitive Pixmap GreyPixmapinternational International Boolean C
Athena Widget Set libXaw 1.0.7width The height and width of this widget in pixels.highlight Apixel value which indexesthe widget’scolormap to derive t
Athena Widget Set libXaw 1.0.7This function is used by the StripChart to call an application routine. The routine will pass thevalue to be graphed bac
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default Valuefont Font XFontStruct XtDefaultFontfontSet FontSet XFontSet XtDefaultFontSetforegroun
Athena Widget Set libXaw 1.0.7callback A list of routines to be called when the notify action is invoked.colormap The colormap that this widget will u
Athena Widget Set libXaw 1.0.7label Specifies the text string to be displayed in the widget’swindowifnobit-map is specified. The default is the name of
Athena Widget Set libXaw 1.0.7yThe location of the upper left outside corner of this widget in its parent.3.10.2. Toggle ActionsThe Toggle widget supp
Athena Widget Set libXaw 1.0.7•Model•Conventions used in this manual•Format of the Widget Reference Chapters1.2. TerminologyIn addition to the terms a
Athena Widget Set libXaw 1.0.73.10.4. Radio GroupsThere are typically twotypes of radio groups desired by applications. The default translations forth
Athena Widget Set libXaw 1.0.7XawToggleSetCurrent locates the Toggle widget to be set by matching radio_data against theradioData for each Toggle in t
Athena Widget Set libXaw 1.0.7Chapter 4MenusThe Athena widget set provides support for single paned non-hierarchical popup and pulldownmenus. Since me
Athena Widget Set libXaw 1.0.7Class simpleMenuWidgetClassClass Name SimpleMenuSuperclass OverrideShellThe SimpleMenu widget is a container for the men
Athena Widget Set libXaw 1.0.7ancestorSensitive The sensitivity state of the ancestors of this widget. Awidget is insensi-tive ifeither it or anyofits
Athena Widget Set libXaw 1.0.7whether or not a windowmanager may interpose itself between this win-dowand the root windowofthe display.For more inform
Athena Widget Set libXaw 1.0.7notify() Notifies the menu entry that is currently highlighted that is has beenselected. It is the responsibility of the
Athena Widget Set libXaw 1.0.7Widget XawSimpleMenuGetActiveEntry(w)Widget w;w Specifies the SimpleMenu widget.This function returns the menu entry that
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default Valuewidth Width Dimension ATextWidth + marginsancestorSensitive The sensitivity state of
Athena Widget Set libXaw 1.0.7The default value for this resource (25) causes the default height to be125% of the height of the font.4.4. SmeLine Obje
Athena Widget Set libXaw 1.0.7WidgetAn object providing a user-interface abstraction (for example, a Scrollbar widget).Widget classThe general group t
Athena Widget Set libXaw 1.0.7Class Name SmeSuperclass RectObjThe Sme object is the base class for all menu entries. While this object is mainly inten
Athena Widget Set libXaw 1.0.73) XtSetValues calls may come from the application while the Sme is highlighted, and if the Set-Values method returns Tr
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default ValueinternalHeight Height Dimension 2internalWidth Width Dimension 4international Interna
Athena Widget Set libXaw 1.0.7cursorName The name of the symbol to use to represent the pointer cursor.Thisresource will override the cursor resource
Athena Widget Set libXaw 1.0.7spring_loaded. The MenuButton widget does not copythe value of thisresource into newly allocated memory.The application
Athena Widget Set libXaw 1.0.7procedure. If no argument is passed, WhenUnset is assumed.unhighlight() Displays the internal highlight border in the co
Athena Widget Set libXaw 1.0.7Chapter 5Text WidgetsThe Textwidget provides a windowthat will allowanapplication to display and edit one or morelines o
Athena Widget Set libXaw 1.0.7Ctrl-o Newline And Backup Meta-< Beginning Of FileCtrl-p Previous Line Meta-> End Of FileCtrl-r Search/Replace Bac
Athena Widget Set libXaw 1.0.7Using these special key sequences should allowsimple searches without everremoving one’shands from the keyboard.Near the
Athena Widget Set libXaw 1.0.7Label labelTe x ttextCommand insertCommand cancel5.1.4. Text Selections for UsersThe text widgets have a textselection m
Athena Widget Set libXaw 1.0.71.5. Format of the Widget Reference ChaptersThe majority of this document is a reference guide for the Athena widget set
Athena Widget Set libXaw 1.0.7beginning-of-file select-endend-of-file extend-startscroll-one-line-up extend-adjustscroll-one-line-down extend-endinsert-
Athena Widget Set libXaw 1.0.7next-page( )previous-page( ) These actions move the insert point up or down one page in thefile. One page is defined as th
Athena Widget Set libXaw 1.0.7ev e nt) or text cursor location (if triggered by a key event).extend-adjust( ) This action allows a selection started w
Athena Widget Set libXaw 1.0.7insert-char( ) This action may only be attached to a key event. When the inter-national resource is false,this action ca
Athena Widget Set libXaw 1.0.7only on Textwidgets that use ASCII text.transpose-characters( ) This action will swap the position of the character to t
Athena Widget Set libXaw 1.0.7XawselectPara-graphSelects the entire paragraph.XawselectPosition Selects the current pointer position.XawselectWord Sel
Athena Widget Set libXaw 1.0.7:Meta<Key>H: backward-kill-word( ) \n\:Meta<Key>\<: beginning-of-file( ) \n\:Meta<Key>\>: end-of-
Athena Widget Set libXaw 1.0.7ptr Contains the string to be referenced by the Textwidget.format This flag indicates whether the data pointed to by ptr
Athena Widget Set libXaw 1.0.7end Specifies the ending character position of the text replacement.text Specifies the text to be inserted into the file.Th
Athena Widget Set libXaw 1.0.7void XawTextEnableRedisplay(w)Widget w;w Specifies the Textwidget.The XawTextEnableRedisplay function flushes anychanges d
Athena Widget Set libXaw 1.0.7DDonot modify this resource. While setting this resource will work, it can cause unex-pected behavior.When this symbol a
Athena Widget Set libXaw 1.0.7To obtain the current position of the insertion point, use XawTextGetInsertionPoint:XawTextPosition XawTextGetInsertionP
Athena Widget Set libXaw 1.0.7management), and a ‘‘Sink’’(which handles the display). There are currently twosupportedsources, the AsciiSrc and MultiS
Athena Widget Set libXaw 1.0.7Name Class Type Notes Default ValuetextSink TextSink Widget An AsciiSinktextSource TextSource Widget An AsciiSrctopMargi
Athena Widget Set libXaw 1.0.7dataCompression The AsciiSrc uses an algorithm that may cause the text buffer to growtoabout twice the size of the actua
Athena Widget Set libXaw 1.0.7pointerColorBackground A pixel value which indexesthe widget’scolormap to derive thebackground color of the pointer symb
Athena Widget Set libXaw 1.0.7resources to point to an MultiSink and MultiSrc respectively.Wheninternational is set to false the AsciiTextwidget initi
Athena Widget Set libXaw 1.0.7The AsciiSrc can be either of twotypes: XawAsciiFile or XawAsciiString.AsciiSrc objects of type XawAsciiFile read the te
Athena Widget Set libXaw 1.0.7If this resource is True,the AsciiSrc will compress its data to the mini-mum size required every time the text string is
Athena Widget Set libXaw 1.0.7memory by freeing this string as soon as you are done with it by calling XawAsciiSource-FreeString.void XawAsciiSourceFr
Athena Widget Set libXaw 1.0.7with MultiSink differences noted only as theyoccur.The AsciiSink will display all printing char-acters in an 8 bit font,
Kommentare zu diesen Handbüchern