Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!kimba!hvr From: hvr@kimba.Sun.COM (Heather Rose) Newsgroups: comp.windows.x Subject: Re: Widget Client data (info request) Message-ID: <132264@sun.Eng.Sun.COM> Date: 27 Feb 90 02:47:14 GMT References: <8395@shlump.nac.dec.com> Sender: news@sun.Eng.Sun.COM Reply-To: hvr@sun.UUCP (Heather Rose) Organization: Sun Microsystems, Mountain View Lines: 40 In article <8395@shlump.nac.dec.com> nick@deccan.dec.com (Nick Tsivranidis) writes: > > I was under the impression that one could associate a client data >field with a widget (ala Suntools). Is there such a thing? Client data >is a piece of application data (normally a memory address) that one can >associate with a widget. This provides for a convenient mapping between >Widget space and Application space. Thanx in advance. XView provides this (as did SunView). Here's a summary of how it works at the end of this message. Regards, Heather ---------------------------- int INSTANCE; main(){ Data data; data = (Data)malloc(DataSize); ... INSTANCE = xv_unique_key(); ... obj = xv_create(owner, OBJ_TYPE, ... XV_KEY_DATA, INSTANCE, data, ... NULL); ... xv_main_loop(frame); } callback_proc(obj, ...) ... data = (Data) xv_get(obj, XV_KEY_DATA, INSTANCE, NULL); ... }