[Xcb] How to associate user/misc pointer with an xcb_window_t

Sam Varshavchik mrsam at courier-mta.com
Wed Dec 25 16:21:53 PST 2013

Josh Triplett writes:

> There's no built-in means of associating data with an XCB data
> structure; XCB stores data as it appears in the X11 protocol, which does
> not include auxiliary data pointers.
> In the case of windows and other XID types, I'd suggest using the XIDs
> as keys in an associative array of your own construction, with whatever
> data you need as the corresponding value.  Most sensible UI libraries
> either have or build on a library of data structures that C doesn't
> already have, notably associative arrays.

Well, C++ in my case – which comes with associative arrays straight from  
the factory. A std::map keyed by an xcb_window_t is a no-brainer; just  
wanted to make sure that I did not overlook something obvious.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20131225/b2caa75a/attachment.pgp>

More information about the Xcb mailing list