GLG Toolkit, C / C++ API Library  Version 4.6

This group contains methods for getting and setting resource values, as well as checking if a named resource exits. More...

Detailed Description

This group contains methods for getting and setting resource values, as well as checking if a named resource exits.

Resource Access Performance Optimization

If NULL is passed as the resource_name parameter of functions for setting and querying resources, the data object supplied by the object parameter will be used directly, avoiding an overhead of a resource search. This can be used to optimize performance when the same resource is accessed repeatedly. The GetResourceObject function of the Intermediate API may be used to obtain an object ID of a data object once and then use it repeatedly.

For example:

// Store a data object for repeated use.
GlgObjectC data_obj = viewport.GetResourceObject( "WaterTank/Level" );
...
// Use the stored data object to update the drawing with data.
if( !data_obj.IsNull() )
data_obj.SetDResource( NULL, new_water_level_value );
The main class of the GLG C++ bindings.
Definition: GlgClass.h:638
GlgObject GetResourceObject(char *resource_name)
Find a resource object.
GlgBoolean SetDResource(char *resource_name, double value)
Sets a new value of a D (double) resource of this object.
GlgBoolean IsNull(void)
Checks if a non-null object is stored in this instance.

The GlgAddDataSampleNode function of the C Intermediate API can also be used instead of setting values of chart entry points to prefill a chart with a large number of data samples.


Using Resource Wildcards

Functions that set resource or tags values support * and ? wildcards for pattern matching. The asterisk (*) matches any sequence of characters, and the question mark (?) matches any single character.

To enable wildcard matching, prefix the resource or tag name with "$!". For example, "$!Clear*" will target all tags with names beginning with "Clear".

When using wildcards in resource paths, the wildcards prefix must be added to each level of resource hierarchy where pattern matching is required. For example, the following string targets all nested elements with names beginning with "Element" inside parent objects with names beginning with "Group":

     $!Group∗/$!Element∗/LineWidth

NOTE: Wildcards can only be used for matching named object resources; they cannot be used for matching default attribute names (e.g. LineWidth, FillColor).


Functions

GlgBoolean GetDResource (char *resource_name, double *value)
 Returns the current value of a D (double) resource of this object. More...
 
GlgBoolean GetGResource (char *resource_name, double *x_value, double *y_value, double *z_value)
 Returns the current value of a G (geometrical or color) resource of this object. More...
 
GlgBoolean GetResource (char *resource_name, char **value)
 Returns the current value of a S (string) resource of this object. More...
 
GlgBoolean GetResource (char *resource_name, double *value)
 Returns the current value of a D (double) resource of this object. More...
 
GlgBoolean GetResource (char *resource_name, double *x_value, double *y_value, double *z_value)
 Returns the current value of a G (geometrical or color) resource of this object. More...
 
GlgBoolean GetSResource (char *resource_name, char **value)
 Returns the current value of a S (string) resource of this object. More...
 
GlgBoolean HasResourceObject (char *resource_name)
 Checks if a named resource of this object exists. More...
 
GlgBoolean SetDResource (char *resource_name, double value)
 Sets a new value of a D (double) resource of this object. More...
 
GlgBoolean SetDResourceIf (char *resource_name, double value, GlgBoolean if_changed)
 Sets a new value of a D (double) resource of this object. More...
 
GlgBoolean SetGResource (char *resource_name, double x_value, double y_value, double z_value)
 Sets new values of a G (geometrical or color) resource of this object. More...
 
GlgBoolean SetGResourceIf (char *resource_name, double x_value, double y_value, double z_value, GlgBoolean if_changed)
 Sets new values of a G (geometrical or color) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, char *format, double value)
 Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string. More...
 
GlgBoolean SetResource (char *resource_name, char *format, double value, GlgBoolean if_changed)
 Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string. More...
 
GlgBoolean SetResource (char *resource_name, char *value)
 Replaces the string of an S (string) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, char *value, GlgBoolean if_changed)
 Replaces the string of an S (string) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, double value)
 Sets a new value of a D (double) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, double value, GlgBoolean if_changed)
 Sets a new value of a D (double) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, double x_value, double y_value, double z_value)
 Sets new values of a G (geometrical or color) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, double x_value, double y_value, double z_value, GlgBoolean if_changed)
 Sets new values of a G (geometrical or color) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, GlgObjectC &value)
 Sets the value of a data or matrix object using another object of the same type and data type. More...
 
GlgBoolean SetResource (char *resource_name, GlgObjectC &value, GlgBoolean if_changed)
 Sets the value of a data or matrix object using another object of the same type and data type. More...
 
GlgBoolean SetResourceFromObject (char *resource_name, GlgObjectC &value)
 Sets the value of a data or matrix object using another object of the same type and data type. More...
 
GlgBoolean SetResourceFromObjectIf (char *resource_name, GlgObjectC &value, GlgBoolean if_changed)
 Sets the value of a data or matrix object using another object of the same type and data type. More...
 
GlgBoolean SetSResource (char *resource_name, char *value)
 Replaces the string of an S (string) resource of this object. More...
 
GlgBoolean SetSResourceFromD (char *resource_name, char *format, double value)
 Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string. More...
 
GlgBoolean SetSResourceFromDIf (char *resource_name, char *format, double value, GlgBoolean if_changed)
 Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string. More...
 
GlgBoolean SetSResourceIf (char *resource_name, char *value, GlgBoolean if_changed)
 Replaces the string of an S (string) resource of this object. More...
 

Function Documentation

◆ GetDResource()

GlgBoolean GetDResource ( char *  resource_name,
double *  value 
)

Returns the current value of a D (double) resource of this object.

This is a wrapper for GlgGetDResource.

Parameters
resource_nameSpecifies the resource path of the scalar resource to query.
valueSpecifies a pointer used to return the resource value.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method copies its current value into the address specified by the value pointer and returns True, otherwise it generates an error message and returns False.

◆ GetGResource()

GlgBoolean GetGResource ( char *  resource_name,
double *  x_value,
double *  y_value,
double *  z_value 
)

Returns the current value of a G (geometrical or color) resource of this object.

This is a wrapper for GlgGetGResource.

Parameters
resource_nameSpecifies the resource path of the G resource to query.
x_valueSpecifies a pointer used to return the X value of a geometrical resource or an R component of the color resource.
y_valueSpecifies a pointer used to return the Y value of a geometrical resource or a G component of the color resource.
z_valueSpecifies a pointer used to return the Z value of a geometrical resource or a B component of the color resource.
Returns
Success or failure status.

If a G resource or with the given resource path exists, this method copies its current three values to the addresses specified with the x_value, y_value and z_value pointers and returns True. Otherwise it generates an error message and returns False.

◆ GetResource() [1/3]

GlgBoolean GetResource ( char *  resource_name,
char **  value 
)

Returns the current value of a S (string) resource of this object.

This is an overloaded version of GetSResource.

Parameters
resource_nameSpecifies the resource path of the string resource to query.
valueSpecifies a pointer used to return the resource value.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method copies the string pointer into the address specified by value pointer and returns True, otherwise it generates an error message and returns False.

Warning: The returned pointer points to GLG internal data structures and should not be modified. The pointer is valid only immediately after a call to GlgGetSResource. To store the returned string, create a copy of it using GlgStrClone.

◆ GetResource() [2/3]

GlgBoolean GetResource ( char *  resource_name,
double *  value 
)

Returns the current value of a D (double) resource of this object.

This is an overloaded version of GetDResource.

Parameters
resource_nameSpecifies the resource path of the scalar resource to query.
valueSpecifies a pointer used to return the resource value.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method copies its current value into the address specified by the value pointer and returns True, otherwise it generates an error message and returns False.

◆ GetResource() [3/3]

GlgBoolean GetResource ( char *  resource_name,
double *  x_value,
double *  y_value,
double *  z_value 
)

Returns the current value of a G (geometrical or color) resource of this object.

This is an overloaded version of GetGResource.

Parameters
resource_nameSpecifies the resource path of the G resource to query.
x_valueSpecifies a pointer used to return the X value of a geometrical resource or an R component of the color resource.
y_valueSpecifies a pointer used to return the Y value of a geometrical resource or a G component of the color resource.
z_valueSpecifies a pointer used to return the Z value of a geometrical resource or a B component of the color resource.
Returns
Success or failure status.

If a G resource or with the given resource path exists, this method copies its current three values to the addresses specified with the x_value, y_value and z_value pointers and returns True. Otherwise it generates an error message and returns False.

◆ GetSResource()

GlgBoolean GetSResource ( char *  resource_name,
char **  value 
)

Returns the current value of a S (string) resource of this object.

This is a wrapper for GlgGetSResource.

Parameters
resource_nameSpecifies the resource path of the string resource to query.
valueSpecifies a pointer used to return the resource value.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method copies the string pointer into the address specified by value pointer and returns True, otherwise it generates an error message and returns False.

Warning: The returned pointer points to GLG internal data structures and should not be modified. The pointer is valid only immediately after a call to GlgGetSResource. To store the returned string, create a copy of it using GlgStrClone.

◆ HasResourceObject()

GlgBoolean HasResourceObject ( char *  resource_name)

Checks if a named resource of this object exists.

This is a wrapper for GlgHasResourceObject.

Parameters
resource_nameSpecifies the resource path of the resource object to query.
Returns
True if a resource object with the given resource path exists, otherwise it returns False without generating an error message.

◆ SetDResource()

GlgBoolean SetDResource ( char *  resource_name,
double  value 
)

Sets a new value of a D (double) resource of this object.

This is a wrapper for GlgSetDResource.

Parameters
resource_nameSpecifies the resource path of the scalar resource to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies a new value.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns True, otherwise it generates an error message and returns False.

See Resource Access Optimization for more.

◆ SetDResourceIf()

GlgBoolean SetDResourceIf ( char *  resource_name,
double  value,
GlgBoolean  if_changed 
)

Sets a new value of a D (double) resource of this object.

This is a wrapper for GlgSetDResourceIf.

Parameters
resource_nameSpecifies the resource path of the scalar resource to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies a new value.
if_changedIf set to False, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed. The parameter is ignored when updating chart entry points to allow plotting straight lines when the plotted value does not change over time.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns True, otherwise it generates an error message and returns False.

See Resource Access Optimization for more.

◆ SetGResource()

GlgBoolean SetGResource ( char *  resource_name,
double  x_value,
double  y_value,
double  z_value 
)

Sets new values of a G (geometrical or color) resource of this object.

This is a wrapper for GlgSetGResource.

Parameters
resource_nameSpecifies the resource path of the geometrical or color resource to be set. May use wildcards, see Using Resource Wildcards.
x_valueSpecifies the new X value.
y_valueSpecifies the new Y value.
z_valueSpecifies the new Z value.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns True, otherwise it generates an error message and returns False.

See Resource Access Optimization for more.

◆ SetGResourceIf()

GlgBoolean SetGResourceIf ( char *  resource_name,
double  x_value,
double  y_value,
double  z_value,
GlgBoolean  if_changed 
)

Sets new values of a G (geometrical or color) resource of this object.

This is a wrapper for GlgSetGResourceIf.

Parameters
resource_nameSpecifies the resource path of the geometrical or color resource to be set. May use wildcards, see Using Resource Wildcards.
x_valueSpecifies the new X value.
y_valueSpecifies the new Y value.
z_valueSpecifies the new Z value.
if_changedIf set to False, the graphical updates will be performed even if the new values are the same as the old one (equivalent to SetGResource). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns True, otherwise it generates an error message and returns False.

See Resource Access Optimization for more.

◆ SetResource() [1/10]

GlgBoolean SetResource ( char *  resource_name,
char *  format,
double  value 
)

Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string.

This is an overloaded version of SetSResourceFromD.

Parameters
resource_nameSpecifies the resource path of the string resource to be set. May use wildcards, see Using Resource Wildcards.
formatSpecifies the printf-style format to use when setting the resource string.
valueSpecifies the numerical value to be converted to a string according to the specified format.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns True, otherwise it generates an error message and returns False.

The memory associated with the old string is automatically freed.

See Resource Access Optimization for more.

◆ SetResource() [2/10]

GlgBoolean SetResource ( char *  resource_name,
char *  format,
double  value,
GlgBoolean  if_changed 
)

Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string.

This is an overloaded version of SetSResourceFromDIf.

Parameters
resource_nameSpecifies the resource path of the string resource to be set. May use wildcards, see Using Resource Wildcards.
formatSpecifies the printf-style format to use when setting the resource string.
valueSpecifies the numerical value to be converted to a string according to the specified format.
if_changedIf set to False, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetSResourceFromD). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatted using the format argument and returns True, otherwise it generates an error message and returns False.

The memory associated with the old string is automatically freed.

See Resource Access Optimization for more.

◆ SetResource() [3/10]

GlgBoolean SetResource ( char *  resource_name,
char *  value 
)

Replaces the string of an S (string) resource of this object.

This is an overloaded version of SetSResource.

Parameters
resource_nameSpecifies the resource path of the string resource to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies a new string.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method creates a copy of the input string, sets that copy as the new value of the resource and returns True, otherwise it generates an error message and returns False.

The memory associated with the old string is automatically freed.

See Resource Access Optimization for more.

◆ SetResource() [4/10]

GlgBoolean SetResource ( char *  resource_name,
char *  value,
GlgBoolean  if_changed 
)

Replaces the string of an S (string) resource of this object.

This is an overloaded version of SetSResourceIf.

Parameters
resource_nameSpecifies the resource path of the string resource to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies a new string.
if_changedIf set to False, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetSResource). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method creates a copy of the input string, sets that copy as the new value of the resource and returns True, otherwise it generates an error message and returns False.

The memory associated with the old string is automatically freed.

See Resource Access Optimization for more.

◆ SetResource() [5/10]

GlgBoolean SetResource ( char *  resource_name,
double  value 
)

Sets a new value of a D (double) resource of this object.

This is an overloaded version of SetDResource.

Parameters
resource_nameSpecifies the resource path of the scalar resource to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies a new value.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns True, otherwise it generates an error message and returns False.

See Resource Access Optimization for more.

◆ SetResource() [6/10]

GlgBoolean SetResource ( char *  resource_name,
double  value,
GlgBoolean  if_changed 
)

Sets a new value of a D (double) resource of this object.

This is an overloaded version of SetDResourceIf.

Parameters
resource_nameSpecifies the resource path of the scalar resource to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies a new value.
if_changedIf set to False, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed. The parameter is ignored when updating chart entry points to allow plotting straight lines when the plotted value does not change over time.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns True, otherwise it generates an error message and returns False.

See Resource Access Optimization for more.

◆ SetResource() [7/10]

GlgBoolean SetResource ( char *  resource_name,
double  x_value,
double  y_value,
double  z_value 
)

Sets new values of a G (geometrical or color) resource of this object.

This is an overloaded version of SetGResource.

Parameters
resource_nameSpecifies the resource path of the geometrical or color resource to be set. May use wildcards, see Using Resource Wildcards.
x_valueSpecifies the new X value.
y_valueSpecifies the new Y value.
z_valueSpecifies the new Z value.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns True, otherwise it generates an error message and returns False.

See Resource Access Optimization for more.

◆ SetResource() [8/10]

GlgBoolean SetResource ( char *  resource_name,
double  x_value,
double  y_value,
double  z_value,
GlgBoolean  if_changed 
)

Sets new values of a G (geometrical or color) resource of this object.

This is an overloaded version of SetGResourceIf.

Parameters
resource_nameSpecifies the resource path of the geometrical or color resource to be set. May use wildcards, see Using Resource Wildcards.
x_valueSpecifies the new X value.
y_valueSpecifies the new Y value.
z_valueSpecifies the new Z value.
if_changedIf set to False, the graphical updates will be performed even if the new values are the same as the old one (equivalent to SetGResource). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns True, otherwise it generates an error message and returns False.

See Resource Access Optimization for more.

◆ SetResource() [9/10]

GlgBoolean SetResource ( char *  resource_name,
GlgObjectC value 
)

Sets the value of a data or matrix object using another object of the same type and data type.

This is an overloaded version of SetResourceFromObject.

Parameters
resource_nameSpecifies the name of the resource of this object to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies the object containing the new value.
Returns
Success or failure status.

If a resource of a matching type at the given resource path exists, the method sets the value of the resource to a value defined by the value object and returns True, otherwise it generates an error message and returns False.

The object type (and data type for the data object) of the resource specified by the resource path should match the type of the value object.

See Resource Access Optimization for more.

◆ SetResource() [10/10]

GlgBoolean SetResource ( char *  resource_name,
GlgObjectC value,
GlgBoolean  if_changed 
)

Sets the value of a data or matrix object using another object of the same type and data type.

This is an overloaded version of SetResourceFromObjectIf.

Parameters
resource_nameSpecifies the name of the resource of this object to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies the object containing the new value.
if_changedIf set to False, the graphical updates will be performed even if the new value is the same as the old one (equivalent to GlgSetResourceFromObject). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a resource of a matching type at the given resource path exists, the method sets the value of the resource to a value defined by the value object and returns True, otherwise it generates an error message and returns False.

The object type (and data type for the data object) of the resource specified by the resource path should match the type of the value object.

See Resource Access Optimization for more.

◆ SetResourceFromObject()

GlgBoolean SetResourceFromObject ( char *  resource_name,
GlgObjectC value 
)

Sets the value of a data or matrix object using another object of the same type and data type.

This is a wrapper for GlgSetResourceFromObject.

Parameters
resource_nameSpecifies the name of the resource of this object to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies the object containing the new value.
Returns
Success or failure status.

If a resource of a matching type at the given resource path exists, the method sets the value of the resource to a value defined by the value object and returns True, otherwise it generates an error message and returns False.

The object type (and data type for the data object) of the resource specified by the resource path should match the type of the value object.

See Resource Access Optimization for more.

◆ SetResourceFromObjectIf()

GlgBoolean SetResourceFromObjectIf ( char *  resource_name,
GlgObjectC value,
GlgBoolean  if_changed 
)

Sets the value of a data or matrix object using another object of the same type and data type.

This is a wrapper for GlgSetResourceFromObjectIf.

Parameters
resource_nameSpecifies the name of the resource of this object to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies the object containing the new value.
if_changedIf set to False, the graphical updates will be performed even if the new value is the same as the old one (equivalent to GlgSetResourceFromObject). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a resource of a matching type at the given resource path exists, the method sets the value of the resource to a value defined by the value object and returns True, otherwise it generates an error message and returns False.

The object type (and data type for the data object) of the resource specified by the resource path should match the type of the value object.

See Resource Access Optimization for more.

◆ SetSResource()

GlgBoolean SetSResource ( char *  resource_name,
char *  value 
)

Replaces the string of an S (string) resource of this object.

This is a wrapper for GlgSetSResource.

Parameters
resource_nameSpecifies the resource path of the string resource to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies a new string.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method creates a copy of the input string, sets that copy as the new value of the resource and returns True, otherwise it generates an error message and returns False.

The memory associated with the old string is automatically freed.

See Resource Access Optimization for more.

◆ SetSResourceFromD()

GlgBoolean SetSResourceFromD ( char *  resource_name,
char *  format,
double  value 
)

Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string.

This is a wrapper for GlgSetSResourceFromD.

Parameters
resource_nameSpecifies the resource path of the string resource to be set. May use wildcards, see Using Resource Wildcards.
formatSpecifies the printf-style format to use when setting the resource string.
valueSpecifies the numerical value to be converted to a string according to the specified format.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns True, otherwise it generates an error message and returns False.

The memory associated with the old string is automatically freed.

See Resource Access Optimization for more.

◆ SetSResourceFromDIf()

GlgBoolean SetSResourceFromDIf ( char *  resource_name,
char *  format,
double  value,
GlgBoolean  if_changed 
)

Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string.

This is a wrapper for GlgSetSResourceFromDIf.

Parameters
resource_nameSpecifies the resource path of the string resource to be set. May use wildcards, see Using Resource Wildcards.
formatSpecifies the printf-style format to use when setting the resource string.
valueSpecifies the numerical value to be converted to a string according to the specified format.
if_changedIf set to False, the graphical updates will be performed even if the new value is the same as the old one (equivalent to GlgSetSResourceFromD). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatted using the format argument and returns True, otherwise it generates an error message and returns False.

The memory associated with the old string is automatically freed.

See Resource Access Optimization for more.

◆ SetSResourceIf()

GlgBoolean SetSResourceIf ( char *  resource_name,
char *  value,
GlgBoolean  if_changed 
)

Replaces the string of an S (string) resource of this object.

This is a wrapper for GlgSetSResourceIf.

Parameters
resource_nameSpecifies the resource path of the string resource to be set. May use wildcards, see Using Resource Wildcards.
valueSpecifies a new string.
if_changedIf set to False, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetSResource). Setting if_changed=True optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method creates a copy of the input string, sets that copy as the new value of the resource and returns True, otherwise it generates an error message and returns False.

The memory associated with the old string is automatically freed.

See Resource Access Optimization for more.