Why is ITextFont is a CONST in struct IntuiText in intuition.h
Post date
Wed, 04/08/2026 - 12:56
The ITextFont seems to be a field that is supposed to be changed, but I get warnings about changing a CONST field. Why is that?
This is the IntuiText structure from intuition.h
struct IntuiText
{
UBYTE FrontPen, BackPen; /* the pen numbers for the rendering */
UBYTE DrawMode; /* the mode for rendering the text */
WORD LeftEdge; /* relative start location for the text */
WORD TopEdge; /* relative start location for the text */
CONST struct TextAttr *ITextFont; /* if NULL, you accept the default */
STRPTR IText; /* pointer to null-terminated text */
struct IntuiText *NextText; /* pointer to another IntuiText to render */
};
Online Status
The declaration means a (non-const) pointer to
conststructure. Then you should declare yourTextAttrstructure asconst.