PtText widget: making cursor visible

I’m building a dialog containing a virtual keyboard for use with a
touch screen. It has a PtText widget to display the current string
and buttons representing alphanumeric and cursor control characters.
The initial string is transferred from another PtText box.

Interaction is pretty much working. That is, my callbacks can alter
the internal character buffer which is properly dumped back to the
display PtText widget via PtSetResource(ABW_x, Pt_ARG_TEXT_STRING,
buf, 0).

What’s not working is cursor display. I think the properties are set
correctly (e.g. Pt_CURSOR_VISIBLE is set) but cursor display and
position are not under program control. I can cheat and use my mouse
to pop up a cursor but that’s just not right.

What function call am I missing? (Online help has not a lot to say
about cursor appearance.)

rlb wrote:

What’s not working is cursor display. I think the properties are set
correctly (e.g. Pt_CURSOR_VISIBLE is set) but cursor display and
position are not under program control. I can cheat and use my mouse
to pop up a cursor but that’s just not right.

PtText only displays its cursor when it has focus. I don’t think
there’s a way to change that.

Wojtech, you’ve done it again.
My alphanumeric buttons rob focus from the display PtText. So, after
processing the key stroke callback and setting the new display text
string, I only needed to do a “PtGiveFocus(ABW_mydisplay, NULL)” to
restore the cursor to visibility.

Thanks, amigo.

rlb wrote:

Wojtech, you’ve done it again.
My alphanumeric buttons rob focus from the display PtText. So, after
processing the key stroke callback and setting the new display text
string, I only needed to do a “PtGiveFocus(ABW_mydisplay, NULL)” to
restore the cursor to visibility.

Wouldn’t it be even simpler to unset the GETS_FOCUS flag of the buttons?