Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!wuarchive!uwm.edu!lll-winken!sun-barr!newstop!exodus!argv From: argv@turnpike.Eng.Sun.COM (Dan Heller) Newsgroups: comp.windows.x.motif Subject: Re: Putting large amount of text into scrolled text widget takes FOREVER Message-ID: <5029@exodus.Eng.Sun.COM> Date: 26 Dec 90 18:35:35 GMT References: <1990Dec13.172420.28263@tse.uucp> Sender: news@exodus.Eng.Sun.COM Organization: O'Reilly && Associates Lines: 18 In article <1990Dec13.172420.28263@tse.uucp> cont1@tse.UUCP (Contractor #1 = Tim Horton) writes: > Inserting large amounts of text (a few hundred lines) into a text widget > takes forever, because the widget resizes itself once for each line of > text in the data as it goes through it, Don't add each line one-by-one. Concatenate all the lines into one very long string (yes, there should be embedded newline characters) and then set the XmNvalue to that string. Just to nit-pick: if all you're setting is XmNvalue, use XmTextSetString instead to avoid the Set-Values method and having to go thru Xt. Also, since you're using SCO UNIX, don't forget to compile with -lmalloc or performance will always be sluggish. -- dan ---------------------------------------------------- O'Reilly && Associates argv@sun.com / argv@ora.com Opinions expressed reflect those of the author only.