home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
- From: rogerr@netcom.com (roger reynolds)
- Newsgroups: fj.mail-lists.x-window
- Subject: WCL/XRM question
- Message-ID: <1992Dec31.151411.18916@sm.sony.co.jp>
- Date: 31 Dec 92 15:14:11 GMT
- Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
- Distribution: fj
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- Lines: 60
- Approved: michael@sm.sony.co.jp
-
- Date: 31 Dec 92 05:10:03 GMT
- Message-Id: <1992Dec31.051003.2980@netcom.com>
- Newsgroups: comp.windows.x,comp.windows.x.motif,comp.windows.x.intrinsics
- Sender: xpert-request@expo.lcs.mit.edu
-
-
-
- Ok, here's one for a true Xrm wizard...
-
- I would like to be able to use the X Resource Database to
- store values for "objects" and "instances of objects" where
- the objects are application defined things, i.e. not widgets.
- (though they certainly contain widgets...)
-
- I have had a fair bit of success at the first part of this,
- by defining a structure and then using XtGetApplicationResources
- to fill in members of that structure. This works swell for
- an "instance" of an object, but I can't get my head around how
- to define resources at the class level.
-
- For anybody who is still following this, perhaps a short example
- to illustrate my question...
-
- Ok, lets say that I have defined a new Class called "Caption",
- and have registered a constructor with WCL to be called when
- an instance of a "Caption" is to be created.
- (Caption is a simple object which binds a label widget to some
- "work area" widget...)
- In my constructor, I create a base widget manager of some type,
- and a label and a work area as its children, and return the base
- widget created.
- Also in my constructor function, I use XtGetApplicationResources
- to fetch the special resources that a Caption knows about.
- Like I say, this all works fine.
-
- Using WCL, the resource file looks like this:
-
- foo.wcCreate: Caption
- foo.labelString: My Caption Label
- foo.workArea: form
- form.wcCreate: XmForm
- ...
-
-
- Now what I'd like to be able to do, is create a class "Caption"
- in the Resource Database that a user can use to set default
- Caption resources, but here I've had little luck.
- The idea would be to be able to say things like :
-
- *Caption*XmLabel.alignment:XmALIGNMENT_CENTER
-
- and so on.
-
-
- Any tips on how to attack this sort of thing, or ideas on what
- to read or where to look for similar examples of Xrm usage
- would be much appreciated...
-
- Thanks,
- rogerr@netcom.com
-