[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

320.0. "Question On List Boxs and Simple Text Widget" by DNGMSE::COPPOLA (Victor Copppola - MKO1-2/D13 - 264-1564) Tue Feb 28 1989 14:55

    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?  
    
    Thanks in advance...
    
    	Vic

T.RTitleUserPersonal
Name
DateLines
320.1list_box and simple_text don't speak the same languageR2ME2::OBRYANWhen in doubt, let the user decide.Tue Feb 28 1989 16:1234
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);}