home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.open-look
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!nuscc!lincoln.technet.sg!ctan
- From: ctan@solomon.technet.sg (Tan Chee Weei)
- Subject: Q: Correct way to handle resources?
- Message-ID: <By5HAu.MDE@lincoln.technet.sg>
- Sender: news@lincoln.technet.sg
- Nntp-Posting-Host: solomon.technet.sg
- Organization: TECHNET, Singapore
- X-Newsreader: TIN [version 1.1 PL6]
- Date: Mon, 23 Nov 1992 03:49:41 GMT
- Lines: 40
-
-
- Can anyone enlighten me on the correct way to query for resources (that the
- user may have specified in his .Xdefaults file) ?
-
- I've seen the use of the defaults_ functions to look for defined (or default)
- values of resources. They each requires a name class pair. What the O'Reilly
- book doesn't explain is the format of the name and class strings. Assume I
- have a subframe in my application and I want to allow the user to specify
- in his .Xdefaults file its geometry. First, is it possible to allow them
- to specify it in WxH+X+Y format? If so, does it mean the application is
- responsible for parsing the value? Is there a function that can extract
- geometry values from strings of this format? Assuming the application
- requires a resource for each value. Let the name of the application be
- xapp. My subframe is referred to as a subframe subobject. I want the
- user to specify the value for the x location value of the subframe as:
-
- xapp.subframe.x: 0
-
- Now, what I want to know is:
-
- 1) In the name string, what must I specify to name the resource? Do I say
- "xapp.subframe.x" (which I know works) or can I say "subframe.x"? Do
- I have to explicitly name the name of the application as part of the
- resource name or would the defaults function be smart enough to know
- to look for the resources for those beginning with xapp or *?
-
- 2) What does the user say in the .Xdefaults file to set the x and y position
- of the base frame? Initially, I set the base frame's x-y value explictly
- but I realised that xv_main_loop() resets these values. What should the
- user specify in the .Xdefaults file to specify the base frame's x-y
- values?
-
- 3) If I were to get the x-y values in 2) above via my own defined resources:
- eg. xapp.main.x and xapp.main.y, what can I do in my application to
- set it so that the values used by xv_main_loop are those I want them to be?
-
- Any other pointers to other sources of information on this subject are also
- much appreciated. Thanks in advance.
-
- CW
-