Logical attributes are generally defined in the header files, and their definitions remain the same during the course of a program. You may want the user to be able to set the color combinations to be used during the course of the program, or you may not want to make your changes in the header file. You can change an existing logical attribute definition at run-time with the logical attribute replace function, latt_rpl():
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The system logical attribute array is #defined as LATT_SYS, for your convenience.
As an example, suppose you want to change the colors associated with the logical attribute LHELP, which is initially defined as high intensity normal for monochrome modes and blue on white for color modes.
|
The function checks what the current video mode is. If it is monochrome, NORMAL is copied into the system logical attribute array. If it is color, the physical attribute byte is determined and copied into the array. Note that this function does not permanently change the system logical attribute table.
The function latt_rpl() works only for existing logical attributes in the array, even if that logical attribute currently has no attributes associated with it. You cannot add a logical attribute to the array with this function.
In order to replace a logical attribute in the table used by a Designer library, you must get a pointer to the table. To do this, use the Designer library logical attributes pointer function dl_lattp():
|
This function returns a pointer to the logical attribute table used by that library. You can then call latt_rpl() using that pointer.