Path: utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!bloom-beacon!ZIA.AOC.NRAO.EDU!cflatter From: cflatter@ZIA.AOC.NRAO.EDU (Chris Flatters) Newsgroups: comp.windows.x Subject: Re: XView XV_KEY_DATA problem Message-ID: <9009172352.AA24028@zia.aoc.nrao.edu> Date: 17 Sep 90 23:52:51 GMT Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 25 > I just ran into a problem with XView's XV_KEY_DATA attribute. It seems > the XView toolkit attaches data to some of the object it creates. > This is fine until you happen to choose the same key as the toolkit. > I attached a pointer with KEY=1 to a panel which is what XView uses to > attach the panel's private structure. There is an (apparently) undocumented function in XView: xv_unique_key() which returns an unused attribute key. Xv_unique_key is used extensively inside XView objects to allocate keys but there are at least two instances (panel and text) where keys are #define'd to 1. I don't know if there is a good reason for these exceptions or whether they are oversites. In practice it makes no difference since xv_unique_key does not return 1 if you have created some XView objects. It is possible that xv_unique_key() is intended for internal use only but it does have uses at the application level. In addition to guaranteeing a unique key for XV_KEY_DATA it is also a good way of assigning client IDs for the notifier. Chris Flatters cflatter@nrao.edu