passing data to a callback
- From: Willem Robert van Hage <wrvh xs4all nl>
- To: gnome-devel-list gnome org
- Subject: passing data to a callback
- Date: Tue, 24 Aug 1999 11:31:44 +0200
I'm rewriting a game I'm working on from only GTK, GDK and GLIB to
some Gnome functions as well and I got a little problem with the
Before I used the ItemFactory to create a gtk menubar
and I could just say
POINTER TO DATA>);"
and I could pass data to all the menu items... I got a big struct that
contains all the data I need in the game, and I want some of the menu
items to be able to print data from that struct...
N_("Print Cycle Counter"), N_("Prints the CYCLE_CNT variable"),
print_cycle_cnt, <MY POINTER TO DATA>, NULL,
NULL, (GdkModifierType)0, NULL
and now that I try to
construct something similar with Gnome it doesn't work,
because it tells me the user_data field isn't constant...
how do I solve this problem?
(I don't want to make the data static, I think that's ugly,
I want to pass it to all the functions that need it.)
email@example.com | http://www.xs4all.nl/~wrvh
firstname.lastname@example.org | http://gene.wins.uva.nl/~wrvhage
] [Thread Prev