[comp.windows.x] Search and Replace in asciiDisk text Widget.

roy@neptune.iex.com (Roy Cantu) (07/13/90)

I was reading through the popuplar /X11/Xaw/TextP.h file 
today and noticed the following structure:


/*
 * Search & Replace data structure.
 */

struct SearchAndReplace {
  Boolean selection_changed;    /* flag so that the selection cannot be
			     	   changed out from underneath query-replace.*/
  Widget search_popup;          /* The poppup widget that allows searches.*/
  Widget label1;                /* The label widgets for the search window. */
  Widget label2;
  Widget left_toggle;           /* The left search toggle radioGroup. */
  Widget right_toggle;          /* The right search toggle radioGroup. */
  Widget rep_label;             /* The Replace label string. */
  Widget rep_text;              /* The Replace text field. */
  Widget search_text;           /* The Search text field. */
  Widget rep_one;               /* The Replace one button. */
  Widget rep_all;               /* The Replace all button. */
};


along with:

  struct SearchAndReplace * search;/*Search and replace structure. */

in the _TextPart structure.


WHAT IS THIS?  Do Text widgets have some built-in search and replace
mechanism?  If so, how can I access this?

Right now I have this asciiDisk Text widget whose contents I would 
like to conduct a search and replace on.  It would be a great help
if I did not have to write my own algorithm, but maybe that is wish-
ful thinking.  Hopefully the above structure contains the answers
that I am looking for.

Suggestions are appreciated.


roy