home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.windows.x.intrinsics:725 comp.windows.x.motif:8396
- Newsgroups: comp.windows.x.intrinsics,comp.windows.x.motif
- Path: sparky!uunet!mcsun!sunic!sics.se!eua.ericsson.se!erix.ericsson.se!per
- From: per@erix.ericsson.se (Per Hedeland)
- Subject: Re: Attach data to widget *other* than via XmNuserData?
- Message-ID: <1993Jan7.143323.7523@eua.ericsson.se>
- Sender: news@eua.ericsson.se
- Nntp-Posting-Host: aalborg.eua.ericsson.se
- Nntp-Posting-User: per
- Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
- References: <BUZZ.93Jan6164723@lion.bear.com>
- Date: Thu, 7 Jan 1993 14:33:23 GMT
- Lines: 38
-
- In article <BUZZ.93Jan6164723@lion.bear.com>, buzz@bear.com (Buzz Moschetti) writes:
- |> Arbitrary data of size <= sizeof(XtPointer) can by attached to a widget
- |> through the XmNuserData resource. Fine.
- |>
- |> Is there any other facility to attached data to a widget? For example,
- |> in XView, there is the XV_KEY_DATA resource as well as PANEL_CLIENT_DATA.
- |> PANEL_CLIENT_DATA works just like XmNuserData:
- |>
- |> My_Data thing;
- |> xv_set(xview_obj, PANEL_CLIENT_DATA, &thing, NULL);
- |>
- |> but XV_KEY_DATA permits you attach an unlimited (sort of) number of
- |> datums, each addressed through a keyval:
- |>
- |> xv_set(xview_obj, XV_KEY_DATA, keyval, &thing, NULL);
- |>
- |> keyval is of type unsigned long and can be hardcoded or generated
- |> at runtime through xv_unique_key():
- |>
- |> keyval = xv_unique_key();
- |>
- |> xv_set(xview_obj, XV_KEY_DATA, keyval, &thing, NULL);
- |> thing *p = (thing *) xv_get(xview_obj, XV_KEY_DATA, keyval);
- |>
- |> Any clues?
-
- You might want to look into the Context Manager (Xlib functions
- XSaveContext(), XFindContext(), XDeleteContext(), XUniqueContext()),
- which provides functionality that appears to be very similar to the
- above. The Xlib manual claims you need an X resource ID, but e.g. a
- Widget ID apparently works too, provided you stick with one or the
- other.
-
- --Per Hedeland
- per@erix.ericsson.se or
- per%erix.ericsson.se@sunic.sunet.se or
- ...uunet!erix.ericsson.se!per
-
-