close window call backs in menus?



Hi,
I need to write a close_window callback accessed from a menu.  I've been
looking at the code in mc and gnome-help-browser and I am a bit bewildered
In the menu data structure, it looks as though the close_cb routines are
being passed NULL for data.

However,  when the callbacks are defined their data contains a data
structure....  How does this work?

Here's what I'm looking at in gnome-help-browser:
(gnome-core/help-browser/window.c):

GnomeUIInfo filemenu[] = {
...
    {GNOME_APP_UI_ITEM,
     N_("Close"), N_("Close window"),
         close_cb, NULL, NULL,
     GNOME_APP_PIXMAP_NONE, NULL,
     0, 0, NULL},
...
    GNOMEUIINFO_END
};
...
static void
close_cb (GtkWidget *w, HelpWindow win)
{
    if (win->close_window_cb)
    (win->close_window_cb)(win);
}


If I understand this correctly, the menu definition should be passing NULL as
the second parameter.  But the close_cb function certainly seems to be
dereferencing a real value....

Any help would be appreciated.
-Toshio
-- 
badger  \"Life is like a china candy dish, filled with brightly promising
@prtr-13 \ sweets, quickly empited.  lasts longer.  dropped.  it breaks."
.ucsc.edu  \~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~



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