Problems inserting text in a PtMultiText widget

Hi NG,

i’m totally new to QNX and the PhAB. I went through all the tutorials in the
QNX help and i have some basics in C.
I am am trying to insert text (via code) in a PtMultiText widget with
PtTextModifyText. The problem is, i don’t see any text in the textfield.
I based my code on the example given in the QNX help (i assume i declared
all variables correctly):

PtSetArg( &args[nargs++], Pt_ARG_DIM, &dim, 0 );
mtext = PtCreateWidget( PtMultiText, NULL, nargs, args );
PtTextModifyText( mtext, NULL, NULL, 0, “Servereply: \n”, 8 );
PtMultiTextModifyText(mtext, NULL, NULL, -1, serverreply.messagetext, strlen
(serverreply.messagetext), &attr, Pt_MT_FONT);
PtRealizeWidget( window );

I tried to modify the code in more than a few ways, always with the same
result —> no visible text.
Without this:

PtSetResources (ABW_multi_display, 1, args);

i don’t even see a widgt in my application.
Inserting text in the PtMultiText widget with Pt_ARG_TEXT_STRING works fine
by the way. But since i need line breaks, i guess i need to use
PtTextModifyText.
Hopefully someone could help me out, or maybe even post a simple example on
how to insert lines without deleting any lines that were already in the
textfield.
I tried to do it with the QNX help, but i don’t seem to get it…

Thanks in advance.

Regards
Helge

Hi Helge,

I don’t know an answer right now, but maybe you could try the newsgroup
“qnx.gui” for your question.

Cheers,

Malte

“Helge Paszkowski” <h.paszkowski@fh-wolfenbuettel.de> schrieb im Newsbeitrag
news:ei7g5l$dd$1@inn.qnx.com

Hi NG,

i’m totally new to QNX and the PhAB. I went through all the tutorials in
the
QNX help and i have some basics in C.
I am am trying to insert text (via code) in a PtMultiText widget with
PtTextModifyText. The problem is, i don’t see any text in the textfield.
I based my code on the example given in the QNX help (i assume i declared
all variables correctly):

PtSetArg( &args[nargs++], Pt_ARG_DIM, &dim, 0 );
mtext = PtCreateWidget( PtMultiText, NULL, nargs, args );
PtTextModifyText( mtext, NULL, NULL, 0, “Servereply: \n”, 8 );
PtMultiTextModifyText(mtext, NULL, NULL, -1, serverreply.messagetext,
strlen
(serverreply.messagetext), &attr, Pt_MT_FONT);
PtRealizeWidget( window );

I tried to modify the code in more than a few ways, always with the same
result —> no visible text.
Without this:

PtSetResources (ABW_multi_display, 1, args);

i don’t even see a widgt in my application.
Inserting text in the PtMultiText widget with Pt_ARG_TEXT_STRING works
fine
by the way. But since i need line breaks, i guess i need to use
PtTextModifyText.
Hopefully someone could help me out, or maybe even post a simple example
on
how to insert lines without deleting any lines that were already in the
textfield.
I tried to do it with the QNX help, but i don’t seem to get it…

Thanks in advance.

Regards
Helge