1SoXtResource(3IV)() SoXtResource(3IV)()
2
3
4
6 SoXtResource — used to retrieve X resources for SoXtComponents and wid‐
7 gets
8
10 SoXtResource
11
13 #include <Inventor/Xt/SoXtResource.h>
14
15 Methods from class SoXtResource:
16
17 SoXtResource(Widget w)
18 ~SoXtResource()
19 SbBool getResource(char *resName, char *resClass, SbColor
20 &c)
21 SbBool getResource(char *resName, char *resClass, short &i)
22 SbBool getResource(char *resName, char *resClass, unsigned
23 short &u)
24 SbBool getResource(char *resName, char *resClass, char *&s)
25 SbBool getResource(char *resName, char *resClass, SbBool &b)
26 SbBool getResource(char *resName, char *resClass, float &f)
27
28
30 This class provides an easy to use interface for retrieving X resource
31 values for widgets and components. Rather than use standard Xt calls to
32 traverse up a widget hierarchy, this class performs its own traversal
33 so that it may provide special care for widgets which are Inventor com‐
34 ponents. For instance, the Inventor Material Editor top level widget is
35 a Motif form widget. Its class name is thus XmForm. SoXtResource knows
36 that the editor is an Inventor component, though, so it uses the class
37 name provided by the editor (in this case "SoXtMaterialEditor") when
38 looking up resource values.
39
40 EXAMPLE:
41 SoXtResource xr( materialEditor->getWidget() );
42 xr.getResource("tile1Color", "Tile1Color", color);
43 xr.getResource("updateFrequency", "UpdateFrequency", freq);
44
45
47 SoXtResource(Widget w)
48 ~SoXtResource()
49 Constructor and destructor. The constructor takes the widget for
50 which it will retrieve resource values.
51
52 SbBool getResource(char *resName, char *resClass, SbColor
53 &c)
54 SbBool getResource(char *resName, char *resClass, short &i)
55 SbBool getResource(char *resName, char *resClass, unsigned
56 short &u)
57 SbBool getResource(char *resName, char *resClass, char *&s)
58 SbBool getResource(char *resName, char *resClass, SbBool &b)
59 SbBool getResource(char *resName, char *resClass, float &f)
60 This returns the X resource value for the specified resource name
61 and class. There is no need to specify the widget hierarchy; this is
62 automatically computed in the constructor.
63
64
66 Components will typically look up their own resources during buildWid‐
67 get(). In order for a component to have its Inventor class name recog‐
68 nized by SoXtResource, it must call SoXtComponent::registerWidget() in
69 its buildWidget() method. (This is done in every Inventor component.)
70
72 X Resources (Xrm), X Intrinsics (Xt), SoXt, SoXtComponent
73
74
75
76
77 SoXtResource(3IV)()