Article View: comp.windows.x
Article #37650Need help deriving new widget from list widget
From: Tom Horsley
Date: Sat, 03 Mar 1990 21:30
Date: Sat, 03 Mar 1990 21:30
47 lines
2969 bytes
2969 bytes
I have been trying to get my mind twisted around the model of programming
that X widgets use, but my recent attempts have convinced me that I need
more help than the opaque (but thick) documentation that comes with the Xaw
library provides.
Here is what I want to do:
I want to make a new widget that has the Xaw List widget as its superclass.
I want to inherit practically everything from the List widget, but I want to
automatically provide the data for the list itself from some special
information derived from one of my new resources (if you need a concrete
example, think of a directory name being passed in as a resource, and the
list being created from the contents of the directory --- this is NOT what I
am doing, but if I could do this, I could also do the more complex task my
application requires).
To me, this seems like a perfect example of what the inheritance mechanism
is all about in the first place, but I cannot figure out how to make it
work.
If I try to write an initialize() procedure for my widget, it gets called
after the List widget has already had its initialize procedure called. But
the List widget is the one that needs to do the initialization after I
provide the list. If I try and use the XtListChange() procedure from within
my initialize procedure it dies because it only seems to work right if the
widget is already realized, but it certainly has not been realized since I
am still in the initialization stage.
Am I simply confused, or is such a simple task really impossible?
I am using X11 R3. Could I simply be encountering yet another problem with
the much maligned List widget in R3 which will go away when we get R4 up and
running? (R4 will be up real soon now...)
Is there is book that is actually in print now describing Xaw toolkit
programming in a less opaque fashion than the stuff that comes with the
release? (especially things like writing new widgets).
I could certainly just make a copy of the whole List widget and add some
junk to the initialize() procedure, but that sort of thwarts the whole
object oriented business, doesn't it?
--
=====================================================================
domain: tahorsley@ssd.csd.harris.com USMail: Tom Horsley
uucp: ...!novavax!hcx1!tahorsley 511 Kingbird Circle
or ...!uunet!hcx1!tahorsley Delray Beach, FL 33444
======================== Aging: Just say no! ========================
Technical Details
Message-ID:
<TOM.90Mar3163037@hcx2.ssd.csd.harris.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!snorkelwacker!usc!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!uflorida!novavax!hcx1!tomShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!snorkelwacker!usc!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!uflorida!novavax!hcx1!tom From: tom@ssd.csd.harris.com (Tom Horsley) Newsgroups: comp.windows.x Subject: Need help deriving new widget from list widget Message-ID: <TOM.90Mar3163037@hcx2.ssd.csd.harris.com> Date: 3 Mar 90 21:30:37 GMT Sender: news@hcx1.SSD.CSD.HARRIS.COM Organization: Harris Computer Systems Division Lines: 47