|
re:.0 -< Question On List Boxs and Simple Text Widget >-
> I'm having a small problem with List Box and Simple Text widgets. I
> select the item from the List box and then display it in the Simple
> Text widget. When I do this the item is displayed with garbage around
> it. My question is how do you display a compound string from the List
> box in the Simple Text Widget?
You cannot display it directly. You must extra the compound string segment
into a null-terminated string before passing it to Stext. (Like C printf,
neither SText nor the command widget understand compound strings. I use
the following C code to extract and print single-segment compound
strings.)
#ifdef F_DEBUG /* These are for use in printf debugging statements below.*/
char *pointer;
DwtCompStringContext context;
long charset_return;
Boolean dirRtoL_return;
long lang_return;
int rend_return;
int status;
#endif
...
DwtInitGetSegment ( &context, CString);
DwtGetNextSegment ( &context,&pointer, &charset_return,
&dirRtoL_return,&lang_return,&rend_return);
printf("%s\n",pointer);}
|