Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoXtResource Class Reference

Used to retrieve X resources for SoXt components and widgets . More...

#include <Inventor/Xt/SoXtResource.h>

Public Member Functions

 SoXtResource (SoWidget w)
 Constructor.
 
 ~SoXtResource ()
 Destructor.
 
SbBool getResource (char *resName, char *resClass, SbColor &c)
 Returns the X resource value for the specified resource name and class.
 
SbBool getResource (char *resName, char *resClass, short &i)
 Returns the X resource value for the specified resource name and class.
 
SbBool getResource (char *resName, char *resClass, unsigned short &u)
 Returns the X resource value for the specified resource name and class.
 
SbBool getResource (char *resName, char *resClass, char *&s)
 Returns the X resource value for the specified resource name and class.
 
SbBool getResource (char *resName, char *resClass, SbBool &b)
 Returns the X resource value for the specified resource name and class.
 
SbBool getResource (char *resName, char *resClass, float &f)
 Returns the X resource value for the specified resource name and class.
 

Detailed Description

Used to retrieve X resources for SoXt components and widgets .

This class provides an easy-to-use interface for retrieving X resource values for widgets and components. Rather than use standard Xt calls to traverse up a widget hierarchy, this class performs its own traversal so that it may provide special care for widgets which are Open Inventor components. For instance, the Open Inventor Material Editor top level widget is a Motif form widget. Its class name is thus XmForm . SoXtResource knows that the editor is an Open Inventor component, though, so it uses the class name provided by the editor (in this case "SoXtMaterialEditor") when looking up resource values.

EXAMPLE:

   SoXtResource xr( materialEditor->getWidget() );
   xr.getResource("tile1Color", "Tile1Color", color);
   xr.getResource("updateFrequency", "UpdateFrequency", freq);

NOTES

    Components will typically look up their own resources during buildWidget(). In order for a component to have its Open Inventor class name recognized by SoXtResource, it must call SoXtComponent::registerWidget() in its buildWidget () method. (This is done in every Open Inventor component.)

SEE ALSO

X Resources (Xrm), X Intrinsics (Xt), SoXt, SoXtComponent

Definition at line 101 of file SoXtResource.h.

Constructor & Destructor Documentation

◆ SoXtResource()

SoXtResource::SoXtResource ( SoWidget  w)

Constructor.

The constructor takes the widget for which it will retrieve resource values.

◆ ~SoXtResource()

SoXtResource::~SoXtResource ( )

Destructor.

Member Function Documentation

◆ getResource() [1/6]

SbBool SoXtResource::getResource ( char *  resName,
char *  resClass,
char *&  s 
)

Returns the X resource value for the specified resource name and class.

There is no need to specify the widget hierarchy; this is automatically computed in the constructor.

◆ getResource() [2/6]

SbBool SoXtResource::getResource ( char *  resName,
char *  resClass,
float &  f 
)

Returns the X resource value for the specified resource name and class.

There is no need to specify the widget hierarchy; this is automatically computed in the constructor.

◆ getResource() [3/6]

SbBool SoXtResource::getResource ( char *  resName,
char *  resClass,
SbBool b 
)

Returns the X resource value for the specified resource name and class.

There is no need to specify the widget hierarchy; this is automatically computed in the constructor.

◆ getResource() [4/6]

SbBool SoXtResource::getResource ( char *  resName,
char *  resClass,
SbColor c 
)

Returns the X resource value for the specified resource name and class.

There is no need to specify the widget hierarchy; this is automatically computed in the constructor.

◆ getResource() [5/6]

SbBool SoXtResource::getResource ( char *  resName,
char *  resClass,
short &  i 
)

Returns the X resource value for the specified resource name and class.

There is no need to specify the widget hierarchy; this is automatically computed in the constructor.

◆ getResource() [6/6]

SbBool SoXtResource::getResource ( char *  resName,
char *  resClass,
unsigned short &  u 
)

Returns the X resource value for the specified resource name and class.

There is no need to specify the widget hierarchy; this is automatically computed in the constructor.


The documentation for this class was generated from the following file: