home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!bcstec!misty!pirson
- From: pirson@misty.boeing.com (Chris Pirson)
- Newsgroups: comp.windows.x.motif
- Subject: Re: Text Field
- Message-ID: <66040005@misty.boeing.com>
- Date: 25 Aug 92 17:26:53 GMT
- References: <20AUG199214084150@utkvx2.utk.edu>
- Organization: Boeing Commercial Airplane BCS Support
- Lines: 62
-
- / misty:comp.windows.x.motif / garbett@utkvx2.utk.edu (Garbett, Shawn) / 12:08 pm Aug 20, 1992 /
- Has anyone mad a text modifier or a Motif Text Field Widget to do
- overstrike mode? I support a user base of about 30 people who
- are used to old block mode editors using overstrike and they
- are complaining about always being in insert mode. Personally
- I think the higher functionality of X this is unnecessary, but
- these users are set in their ways.
-
- Shawn
- Garbett@utkvx.utk.edu
- ----------
-
- There is no direct (nice) way to force the Text or Text Field widget
- into overstrike mode. I have added this Modify Callback to widgets
- which I want to observe the global overstrike_mode_set flag in my
- application. I can't take credit for the logic, but it does work
- nicely.
-
- P.S. I have the same situation here too with our user community. This
- is only the tip of the iceberg when it comes to kludges I have put in
- Motif applications to satisfy the whining of our 24x80 text based users.
- We call it Motif for Dummies.
-
- /*****************************************************************************
- *
- * Function Name: overstrike_editing_cb()
- * File Name: cmdwin_cb.c
- *
- * This function is called whenever a text field is modified. It checks
- * to see if overstrike_mode_set is set. If so, it will delete the next
- * character(s) before inserting. Like it or not, this is overstrike
- * editing!
- *
- * Inputs: w The text widget
- * unused
- * cbs Callback data
- *
- * Returns: Nothing
- *
- * Rev: Description:
- * --- -----------
- *
- *****************************************************************************
- */
- void overstrike_editing_cb(Widget w, XtPointer unused,
- XmTextVerifyCallbackStruct *cbs)
- {
- int i;
-
- if(cbs->reason != XmCR_MODIFYING_TEXT_VALUE) return;
-
- if(overstrike_mode_set) {
- for(i=0; i < cbs->text->length; i++) {
- XtCallActionProc(w, "delete-next-character", cbs->event, NULL, 0);
- }
- }
- }
-
-
- Chris Pirson Flight Test Engineering
- pirson@misty.boeing.com Boeing Commercial Airplanes
- uunet!bcstec!misty!pirson Seattle, WA
-