how to use user_data field in GMarkupParser callbacks?



Hey All,

I've been scouring the documentation and the net trying to figure out
how to (correctly) utilize the "gpointer user_data" parameter to the
GMarkupParser callbacks. The only information the glib documentation
provides in this regard is the function prototype in the api reference,
and i can't find any examples anywhere.

I need to pass in some data to these callback funcs, and i'm stuck
trying to figure out how to register an object to be automatically
passed in when these functions are called (like you can do with a
g_signal_connect, or something). I'm pretty sure g_signal_connect isn't
an option here, since the GMarkupParser doesn't appear to derive from
GObject. Should i put a static gpointer variable in my callbacks, and
then set it by invoking the function manually (this just sounds ugly)
before i start parsing? Or should i consider "going global" :p ?

If someone could give me some pointers (sorry, couldn't resist:) or
point me in the right direction (ok, i'll stop now) i'd much appreciate
it.

thanx in advance,
- gabriel



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]