Re: [gtk-list] using a callback as a normal function
- From: Joshua Richardson <jric bu edu>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] using a callback as a normal function
- Date: Wed, 7 Apr 1999 18:39:12 -0400 (EDT)
> static GtkItemFactoryEntry menu_items[] =
> {
> {"/_File", NULL, NULL, 0, "<Branch>"},
> {"/File/_New", "<control>N", NULL, 0, NULL},
> {"/File/_Open", "<control>O", file_open, 0, NULL},
> ....
> };
>
> how do I pass arguments to this?
Pass arguments to your callback through argument four. To pass the value,
VALUE, to your function, use
static GtkItemFactoryEntry menu_items[] =
{
...
{"/File/_Open", "<control>O", file_open, gpointer(VALUE), NULL},
....
};
This is explained in tutorial 1.2, section 13.4.
Best Wishes, --josh
----------------------------------------------------------------
Joshua Richardson
Dept. Cognitive and Neural Systems / Center for Adaptive Systems
Boston University
----------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]