Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uwm.edu!lll-winken!lll-crg.llnl.gov!uejio From: uejio@lll-crg.llnl.gov (Jeremy Y. Uejio) Newsgroups: comp.windows.x,ba.windows.x Subject: Need help with class data of widgets Message-ID: <47393@lll-winken.LLNL.GOV> Date: 5 Feb 90 19:34:16 GMT Sender: usenet@lll-winken.LLNL.GOV Reply-To: uejio@lll-crg.llnl.gov (Jeremy Y. Uejio) Followup-To: comp.windows.x Distribution: usa Organization: Lawrence Livermore National Laboratory Lines: 30 I'm having trouble understanding the use and access of class data for widgets. Basically, I would like to have a function that is common to a bunch of different widgets that are of different types. For example, I have widgets which are subclasses of command widgets and widgets which are subclasses of AsciiText. I would like to define some sort of generic procedure for both types of widgets so that I can use the same call for both. I.e.: mycommonroutine(object,data); where object is either the command widget or the text widget and data is just some pointer. I'm thinking of using the class data to hold this routine, but then I don't know how to access it or even declare it. Maybe something like: typedef struct _MyTextClassPart { void (*mycommonroutine)(); } MyTextClassPart; Can anyone help me with this? Thanks in advance, jeremy uejio@lll-crg.llnl.gov Jeremy Uejio (pronounced 'oo-ay-joe') uejio@lll-crg.llnl.gov uucp: {gatech,pyramid,rutgers}!lll-crg!uejio other things to try: uejio%lll-crg.llnl.gov@relay.cs.net