Help With Menu Accelerators and GtkItemFactor



Hello, I'm working on developing a GTK 1.2.4 application.  I am
currently wondering how to pass gpointers through menu item
callback functions when my menus have been created through the
item factory.

In an older version of the application I wrote, I used manual 
menu creation.  I'm currently attempting to switch the app
over to the use of the Item Factory.  I was able to create 
the menus OK, but I don't understand how to pass a pointer
to a structure which my menu items need access to.  I
was doing this with gtk_signal_connect.  But I don't 
understand how to tell the callback to pass the gpointer
when I'm using the Item Factory.  I was unable to find an
explanation of how to do this in any of the GTK
documentation and all of the GTK applications I've looked 
t (gzilla, gIDE, gEdit) used their own menu construction
code which I found very confusing.

Currently my app's datastructures are all linked into a 
large struct which I pass around my application code as
a gpointer.  Is this how gtk apps are normally written
or am I missing something?  I'd rather not just make 
everything global as that doesn't seem logical to me. 
However, I am finding passing data around difficult in
GTK - I come from an OO background and don't have much
experience with non-OO programing.  I do not wish to 
use gtk-- to write my app.

Thanks.

        - VAB



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