I'm trying to read the current position of the cursor in a string gadget. This is what I tried which doesn't seem to work.
return_val =(Iintuition->GetAttrs(Object *)gadgets[GID_TITLE_TEXT], STRINGA_DispPos, &cursor_pos, TAG_DONE);
printf("Cursor Position = %ld \n", cursor_pos);
Cursor position is alway 0. I'm out of ideas. Any help!
OK, got t. I neededto use the STRINGA_BufferPos tag as STRINGA_DispPos appears to only be valid when the gadget is active.
IIntuition->GetAttr(STRINGA_BufferPos, (Object *)gadgets[GID_TITLE_TEXT], &cursor_pos);
Also, the autodocs say that the data value for STRINGA_BufferPos is an int16 but it's actually a uint32.