Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!alphalpha.com!nazgul From: nazgul@alphalpha.com (Kee Hinckley) Newsgroups: comp.windows.x.motif Subject: Has anyone used XmStringGetSegment? Message-ID: <9008100138.AA08292@alphalpha.com> Date: 10 Aug 90 01:38:21 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 45 A friend sent me this code, saying it core-dumped on his machine. On mine it just doesn't work. I mucked with it a little to no avail. Note that if you take out the concat and just do it with the first Label it went into an infinite loop printing out null strings. Got me. #include #include void main(argc, argv) int argc; char *argv[]; { XmString Label, s1, s2; XmStringContext Context; char *LabelChars; XmStringCharSet CharSet; XmStringDirection Direction; Boolean Separator; Label = XmStringCreateLtoR("Death", XmSTRING_DEFAULT_CHARSET); s1 = XmStringCreateLtoR("and Taxes", XmSTRING_DEFAULT_CHARSET); Label = XmStringConcat(Label, s1); if (XmStringInitContext(&Context, Label) == False) { printf("XmStringInitContext Failed\n"); exit(0); } while (XmStringGetNextSegment(&Context, &LabelChars, &CharSet, &Direction, &Separator)) { printf("LabelChars='%s'\n", LabelChars); } } Alphalpha Software, Inc. | motif-request@alphalpha.com nazgul@alphalpha.com |----------------------------------- 617/646-7703 (voice/fax) | Proline BBS: 617/641-3722 I'm not sure which upsets me more; that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's. -------