[comp.windows.x.motif] Subclassing XmText

pierson@encore.com (Dan L. Pierson) (06/04/91)

Suddenly, I need to subclass my first widget.  XmText yet!  The good
news is that a trivial subclass will do to start.  What I absolutely
need is a new class name to hang a different set of translations off
of. 

Has anyone out there done this sort of thing?  Any advice would be
very welcome.

--

                                            dan

In real life: Dan Pierson, Encore Computer Corporation, Research
UUCP: {talcott,linus,necis,decvax}!encore!pierson
Internet: pierson@encore.com

marbru@auto-trol.com (Martin Brunecky) (06/11/91)

In article <PIERSON.91Jun4121356@xenna.encore.com> pierson@encore.com (Dan L. Pierson) writes:
>Suddenly, I need to subclass my first widget.  XmText yet!  The good
>news is that a trivial subclass will do to start.  What I absolutely
>need is a new class name to hang a different set of translations off
>of. 
>
 Normally very trivial. You make copy of the public and private header
 files, add your subclass records. You make a copy of the .c file
 with the class definition, copy the existing intialization replacing
 everything inheritable with ...Inherit. Really easy.

 But in the case of XmText I'd be nervous. Many much simpler widgets
 don't like subclassing - just because it has not ever been tried, and
 there are bugs and assumptions that would pop up on the first attempt
 to subclass.
 Actually, in XUI (Motif orgin) they did subclass the Text widget, so
 the chances are it's not so bad. But - beware.


 But many people would rather replace translations using app-defaults
 file(s). Less coding -).



-- 
=*= Opinions presented here are solely of my own and not those of Auto-trol =*=
Martin Brunecky                      marbru%auto-trol@sunpeaks.central.sun.com
(303) 252-2499                       (better avoid:  marbru@auto-trol.COM )
Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404