Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!ucdavis!csusac!unify!openlook!openlook-request From: alanc@coopsol.coopsol.com (Alan Carwile) Newsgroups: comp.windows.open-look Subject: Subclassing OLIT widgets Message-ID: <8uosxon@openlook.Unify.Com> Date: 14 Jun 91 16:47:19 GMT Sender: news@Unify.Com Lines: 53 >From the Widget Writing class at Xhibition last year, plus opinions I see on the net, and my own understanding of Xt... It seems necessary to have source to be able to subclass existing widgets. I'm curious what other people think, and will summarize any email I receive on this topic. I need to subclass several existing OLIT widgets to create more specialized widgets. It's important that I NOT create my widgets off Xt's classes, since I don't have the time to reverse engineer all the existing functionality of the existing OLIT widgets. I just want to focus on the new capabilities that I have to add. However, in some cases, I'll need to "hook into" the methods being used by the parent widget class. For example, to draw a textField widget in some special way based on a resource, I might need to modify a GC and let the parent widget class do the drawing. Alternatively, I could take over the drawing, but I'd have to handle details like how to draw the arrows that appear if the textField can't display all its content. It seems likely to me that OLIT source would therefore be necessary to create widget subclasses that work successfully. I would expect NOT to modify the OLIT source, nor to redistribute it. However, developing and debugging without it sounds like a nightmare. Of course, I have to be careful here. When a new version of OLIT comes out, the implementation of the parent class may change. If I've relied on an implementation detail that changes, my subclass would not work as expected. Ideally then, Sun (or AT&T) would publish information about the OLIT widgets, that would make it feasible to subclass in specialized ways without having to have source. Is there further documentation of this nature for the OLIT widgets? The difficulty comes in projecting the level of information needed with those who subclass an existing widget. The details may seem sufficient to the creator of the parent class, but not to the creator of the subclass. If you have experience with this, please let me know your opinions. Experience with other widget sets (dare I say Motif?) would also be of interest, since this is primarily an X Toolkit question. We currently have OLIT 2.5 from Sun (similar to 4.0 from AT&T). My hope is to move soon to OLIT 3, and get source for Sun's OLIT 3 for use as I create subclasses. ..Thank You... AlanC ------------------------------------------------------------------------------ Alan D. Carwile ! domain: alanc@coopsol.com <-- Best choice Cooperative Solutions, Inc. ! uucp: ..!sun!unisoft!coopsol!alanc 2125 Hamilton Ave. Suite 100 ! or ..!hplabs!pyramid!unisoft!coopsol!alanc San Jose, CA. 95125 ! or ..!uunet.uu.net!unisoft!coopsol!alanc (408) 377-0300 x67 phone ! or ..!uu.psi.com!coopsol!alanc (408) 377-7504 fax ! or coopsol!alanc@uu.psi.com ------------------------------------------------------------------------------