home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / x / motif / 5823 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  2.5 KB

  1. Path: sparky!uunet!bcstec!misty!pirson
  2. From: pirson@misty.boeing.com (Chris Pirson)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re: Text Field
  5. Message-ID: <66040005@misty.boeing.com>
  6. Date: 25 Aug 92 17:26:53 GMT
  7. References: <20AUG199214084150@utkvx2.utk.edu>
  8. Organization: Boeing Commercial Airplane BCS Support
  9. Lines: 62
  10.  
  11. / misty:comp.windows.x.motif / garbett@utkvx2.utk.edu (Garbett, Shawn) / 12:08 pm  Aug 20, 1992 /
  12. Has anyone mad a text modifier or a Motif Text Field Widget to do
  13. overstrike mode? I support a user base of about 30 people who
  14. are used to old block mode editors using overstrike and they
  15. are complaining about always being in insert mode. Personally
  16. I think the higher functionality of X this is unnecessary, but
  17. these users are set in their ways.
  18.  
  19. Shawn 
  20. Garbett@utkvx.utk.edu 
  21. ----------
  22.  
  23. There is no direct (nice) way to force the Text or Text Field widget
  24. into overstrike mode.  I have added this Modify Callback to widgets
  25. which I want to observe the global overstrike_mode_set flag in my
  26. application.  I can't take credit for the logic, but it does work
  27. nicely.
  28.  
  29. P.S.  I have the same situation here too with our user community.  This
  30. is only the tip of the iceberg when it comes to kludges I have put in
  31. Motif applications to satisfy the whining of our 24x80 text based users.
  32. We call it Motif for Dummies.
  33.  
  34. /*****************************************************************************
  35.  *
  36.  *  Function Name:  overstrike_editing_cb()
  37.  *  File Name:      cmdwin_cb.c
  38.  *
  39.  *  This function is called whenever a text field is modified.  It checks 
  40.  *  to see if overstrike_mode_set is set.  If so, it will delete the next
  41.  *  character(s) before inserting.  Like it or not, this is overstrike
  42.  *  editing!
  43.  *
  44.  *  Inputs: w       The text widget
  45.  *          unused
  46.  *          cbs     Callback data
  47.  *
  48.  *  Returns: Nothing
  49.  *
  50.  *  Rev:    Description:
  51.  *  ---     -----------
  52.  *
  53.  *****************************************************************************
  54.  */
  55. void overstrike_editing_cb(Widget w, XtPointer unused,
  56.                               XmTextVerifyCallbackStruct *cbs)
  57. {
  58.     int     i;
  59.  
  60.     if(cbs->reason != XmCR_MODIFYING_TEXT_VALUE) return;
  61.  
  62.     if(overstrike_mode_set) {
  63.         for(i=0; i < cbs->text->length; i++) {
  64.             XtCallActionProc(w, "delete-next-character", cbs->event, NULL, 0);
  65.         }
  66.     }
  67. }
  68.  
  69.  
  70. Chris Pirson                            Flight Test Engineering
  71. pirson@misty.boeing.com                 Boeing Commercial Airplanes
  72. uunet!bcstec!misty!pirson               Seattle, WA
  73.