aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog56
-rwxr-xr-xconfigure22
-rw-r--r--configure.ac6
-rw-r--r--debian/changelog13
-rw-r--r--docs/libdbusmenu-glib/reference/html/ch01.html2
-rw-r--r--docs/libdbusmenu-glib/reference/version.xml2
-rw-r--r--docs/libdbusmenu-gtk/reference/html/ch01.html2
-rw-r--r--docs/libdbusmenu-gtk/reference/version.xml2
-rw-r--r--libdbusmenu-glib/client-menuitem.c2
-rw-r--r--libdbusmenu-glib/client-private.h3
-rw-r--r--libdbusmenu-glib/client.c3
-rw-r--r--libdbusmenu-gtk/client.c31
-rw-r--r--libdbusmenu-gtk/menu.c14
-rw-r--r--libdbusmenu-gtk/parser.c56
14 files changed, 152 insertions, 62 deletions
diff --git a/ChangeLog b/ChangeLog
index 222ade1..0412b00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,61 @@
# Generated by Makefile. Do not edit.
+2011-04-14 Ted Gould <ted@gould.cx>
+
+ 0.4.3
+
+2011-04-12 Ted Gould <ted@gould.cx>
+
+ Handle cases of labels being added later
+
+2011-04-12 Michael Terry <mike@mterry.name>
+
+ watch empty/separator menu items for any added GtkLabel children, as gnome-commander likes to do
+
+2011-04-12 Ted Gould <ted@gould.cx>
+
+ Changing the cleanup of GTK Menuitems to avoid undefined references.
+
+2011-04-10 Ted Gould <ted@gould.cx>
+
+ Ensuring all the menus are hidden before unref'ing root
+
+2011-04-10 Ted Gould <ted@gould.cx>
+
+ Passing the menuitem instead of finding it.
+
+2011-04-10 Ted Gould <ted@gould.cx>
+
+ Protecting the label with the null check and don't unref something that shouldn't be.
+
+2011-04-10 Ted Gould <ted@gould.cx>
+
+ Attaching the data in a way that it'll cleanup itself
+
+2011-04-07 Ted Gould <ted@gould.cx>
+
+ Attaching bug
+
+2011-04-07 Ted Gould <ted@gould.cx>
+
+ We have to destroy, why? Because we want to make sure that the menu having a ref doesn't block us from getting rid of the item.
+
+2011-04-07 Ted Gould <ted@gould.cx>
+
+ Switching the reference to the GTK Menuitem to be a _sink as well as using set_data_full() instead of a weak ref for unref'ing it.
+
+2011-04-12 Ted Gould <ted@gould.cx>
+
+ Ensure that we gaurantee the open/clicked/closed event ordering.
+
+2011-04-08 Michael Terry <mike@mterry.name>
+
+ guard against an activation that does not actually have an associated menu-hide
+
+2011-04-07 Michael Terry <mike@mterry.name>
+
+ force activated event to be sandwiched by opened/closed events
+
2011-04-07 Ted Gould <ted@gould.cx>
0.4.2
diff --git a/configure b/configure
index a07335a..5809cc9 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.2.
+# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.3.
#
# Report bugs to <ted@canonical.com>.
#
@@ -703,8 +703,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libdbusmenu'
PACKAGE_TARNAME='libdbusmenu'
-PACKAGE_VERSION='0.4.2'
-PACKAGE_STRING='libdbusmenu 0.4.2'
+PACKAGE_VERSION='0.4.3'
+PACKAGE_STRING='libdbusmenu 0.4.3'
PACKAGE_BUGREPORT='ted@canonical.com'
PACKAGE_URL=''
@@ -1541,7 +1541,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libdbusmenu 0.4.2 to adapt to many kinds of systems.
+\`configure' configures libdbusmenu 0.4.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1611,7 +1611,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libdbusmenu 0.4.2:";;
+ short | recursive ) echo "Configuration of libdbusmenu 0.4.3:";;
esac
cat <<\_ACEOF
@@ -1751,7 +1751,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libdbusmenu configure 0.4.2
+libdbusmenu configure 0.4.3
generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2122,7 +2122,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libdbusmenu $as_me 0.4.2, which was
+It was created by libdbusmenu $as_me 0.4.3, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
@@ -2943,7 +2943,7 @@ fi
# Define the identity of the package.
PACKAGE=libdbusmenu
- VERSION=0.4.2
+ VERSION=0.4.3
# Some tools Automake needs.
@@ -13294,7 +13294,7 @@ fi
###########################
LIBDBUSMENU_CURRENT=3
-LIBDBUSMENU_REVISION=13
+LIBDBUSMENU_REVISION=14
LIBDBUSMENU_AGE=0
@@ -14616,7 +14616,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libdbusmenu $as_me 0.4.2, which was
+This file was extended by libdbusmenu $as_me 0.4.3, which was
generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14682,7 +14682,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libdbusmenu config.status 0.4.2
+libdbusmenu config.status 0.4.3
configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 0618dd1..c0b70bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,11 @@
-AC_INIT(libdbusmenu, 0.4.2, ted@canonical.com)
+AC_INIT(libdbusmenu, 0.4.3, ted@canonical.com)
AC_COPYRIGHT([Copyright 2009,2010 Canonical])
AC_PREREQ(2.62)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libdbusmenu, 0.4.2, [-Wno-portability])
+AM_INIT_AUTOMAKE(libdbusmenu, 0.4.3, [-Wno-portability])
AM_MAINTAINER_MODE
@@ -134,7 +134,7 @@ AC_PATH_PROG([XSLT_PROC], [xsltproc])
###########################
LIBDBUSMENU_CURRENT=3
-LIBDBUSMENU_REVISION=13
+LIBDBUSMENU_REVISION=14
LIBDBUSMENU_AGE=0
AC_SUBST(LIBDBUSMENU_CURRENT)
diff --git a/debian/changelog b/debian/changelog
index 75bb02f..e9c9c41 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
-libdbusmenu (0.4.2-0ubuntu4) UNRELEASED; urgency=low
+libdbusmenu (0.4.3-0ubuntu1) natty; urgency=low
+ [ Ken VanDine ]
* debian/rules
- Fixed package names in build targets (LP: #760102)
- Dropped makeshlibs in favor of symbols files
@@ -7,7 +8,15 @@ libdbusmenu (0.4.2-0ubuntu4) UNRELEASED; urgency=low
* +debian/libdbusmenu-gtk3-3.symbols
* +debian/libdbusmenu-gtk3.symbols
- -- Ken VanDine <ken.vandine@canonical.com> Thu, 14 Apr 2011 09:27:03 -0400
+ [ Ted Gould ]
+ * New upstream release.
+ ∘ Handle cases where labels are added later as subwidgets
+ in the menuitem (LP: #758759)
+ ∘ Fix the destruction of the attached GTK menuitem (LP: #746091)
+ ∘ Guard against an activation that does not actually have an
+ associated menu-hide (LP: #750588)
+
+ -- Ted Gould <ted@ubuntu.com> Thu, 14 Apr 2011 16:49:13 -0500
libdbusmenu (0.4.2-0ubuntu3) natty; urgency=low
diff --git a/docs/libdbusmenu-glib/reference/html/ch01.html b/docs/libdbusmenu-glib/reference/html/ch01.html
index 0cbf2fa..34a33b2 100644
--- a/docs/libdbusmenu-glib/reference/html/ch01.html
+++ b/docs/libdbusmenu-glib/reference/html/ch01.html
@@ -21,7 +21,7 @@
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id552681"></a>API</h2></div></div></div>
+<a name="id540461"></a>API</h2></div></div></div>
<div class="toc"><dl>
<dt>
<span class="refentrytitle"><a href="libdbusmenu-glib-DbusmenuServer.html">DbusmenuServer</a></span><span class="refpurpose"> — The server signals changed and
diff --git a/docs/libdbusmenu-glib/reference/version.xml b/docs/libdbusmenu-glib/reference/version.xml
index 2b7c5ae..17b2ccd 100644
--- a/docs/libdbusmenu-glib/reference/version.xml
+++ b/docs/libdbusmenu-glib/reference/version.xml
@@ -1 +1 @@
-0.4.2
+0.4.3
diff --git a/docs/libdbusmenu-gtk/reference/html/ch01.html b/docs/libdbusmenu-gtk/reference/html/ch01.html
index 0cf9820..af2a8e4 100644
--- a/docs/libdbusmenu-gtk/reference/html/ch01.html
+++ b/docs/libdbusmenu-gtk/reference/html/ch01.html
@@ -21,7 +21,7 @@
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id463422"></a>API</h2></div></div></div>
+<a name="id403245"></a>API</h2></div></div></div>
<div class="toc"><dl>
<dt>
<span class="refentrytitle"><a href="libdbusmenu-gtk-DbusmenuGtkMenu.html">DbusmenuGtkMenu</a></span><span class="refpurpose"> — A GTK Menu Object that syncronizes over DBus</span>
diff --git a/docs/libdbusmenu-gtk/reference/version.xml b/docs/libdbusmenu-gtk/reference/version.xml
index 2b7c5ae..17b2ccd 100644
--- a/docs/libdbusmenu-gtk/reference/version.xml
+++ b/docs/libdbusmenu-gtk/reference/version.xml
@@ -1 +1 @@
-0.4.2
+0.4.3
diff --git a/libdbusmenu-glib/client-menuitem.c b/libdbusmenu-glib/client-menuitem.c
index 60f8637..483470a 100644
--- a/libdbusmenu-glib/client-menuitem.c
+++ b/libdbusmenu-glib/client-menuitem.c
@@ -106,7 +106,7 @@ static void
handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp)
{
DbusmenuClientMenuitemPrivate * priv = DBUSMENU_CLIENT_MENUITEM_GET_PRIVATE(mi);
- dbusmenu_client_send_event(priv->client, dbusmenu_menuitem_get_id(mi), name, variant, timestamp);
+ dbusmenu_client_send_event(priv->client, dbusmenu_menuitem_get_id(mi), name, variant, timestamp, mi);
return;
}
diff --git a/libdbusmenu-glib/client-private.h b/libdbusmenu-glib/client-private.h
index f6df372..44c0066 100644
--- a/libdbusmenu-glib/client-private.h
+++ b/libdbusmenu-glib/client-private.h
@@ -37,7 +37,8 @@ void dbusmenu_client_send_event (DbusmenuClient * client,
gint id,
const gchar * name,
GVariant * variant,
- guint timestamp);
+ guint timestamp,
+ DbusmenuMenuitem * mi);
void dbusmenu_client_send_about_to_show(DbusmenuClient * client,
gint id,
void (*cb) (gpointer user_data),
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 45cf0d1..2e6b09a 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1516,14 +1516,13 @@ menuitem_call_cb (GObject * proxy, GAsyncResult * res, gpointer userdata)
/* Sends the event over DBus to the server on the other side
of the bus. */
void
-dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name, GVariant * variant, guint timestamp)
+dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name, GVariant * variant, guint timestamp, DbusmenuMenuitem * mi)
{
g_return_if_fail(DBUSMENU_IS_CLIENT(client));
g_return_if_fail(id >= 0);
g_return_if_fail(name != NULL);
DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
- DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id);
if (mi == NULL) {
g_warning("Asked to activate a menuitem %d that we don't know about", id);
return;
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index b2d9f47..5e59f8e 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -690,7 +690,8 @@ process_submenu (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, D
} else {
/* We need to build a menu for these guys to live in. */
GtkMenu * menu = GTK_MENU(gtk_menu_new());
- g_object_set_data(G_OBJECT(mi), data_menu, menu);
+ g_object_ref_sink(menu);
+ g_object_set_data_full(G_OBJECT(mi), data_menu, menu, g_object_unref);
gtk_menu_item_set_submenu(gmi, GTK_WIDGET(menu));
@@ -735,19 +736,6 @@ menu_shortcut_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * value,
return;
}
-/* Call back that happens when the DbusmenuMenuitem
- is destroyed. We're making sure to clean up everything
- else down the pipe. */
-static void
-destoryed_dbusmenuitem_cb (gpointer udata, GObject * dbusmenuitem)
-{
- #ifdef MASSIVEDEBUGGING
- g_debug("DbusmenuMenuitem was destroyed");
- #endif
- gtk_widget_destroy(GTK_WIDGET(udata));
- return;
-}
-
/* The new menuitem signal only happens if we don't have a type handler
for the type of the item. This should be an error condition and we're
printing out a message. */
@@ -850,11 +838,8 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem *
#endif
/* Attach these two */
- g_object_set_data(G_OBJECT(item), data_menuitem, gmi);
- g_object_ref(G_OBJECT(gmi));
- #ifdef MASSIVEDEBUGGING
- g_signal_connect(G_OBJECT(gmi), "destroy", G_CALLBACK(destroy_gmi), item);
- #endif
+ g_object_ref_sink(G_OBJECT(gmi));
+ g_object_set_data_full(G_OBJECT(item), data_menuitem, gmi, (GDestroyNotify)gtk_widget_destroy);
/* DbusmenuMenuitem signals */
g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menu_prop_change_cb), client);
@@ -865,9 +850,6 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem *
/* GtkMenuitem signals */
g_signal_connect(G_OBJECT(gmi), "activate", G_CALLBACK(menu_pressed_cb), item);
- /* Life insurance */
- g_object_weak_ref(G_OBJECT(item), destoryed_dbusmenuitem_cb, gmi);
-
/* Check our set of props to see if any are set already */
process_visible(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_VISIBLE));
process_sensitive(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ENABLED));
@@ -920,7 +902,7 @@ delete_child (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, DbusmenuGtkClient
if (menu != NULL) {
gtk_widget_destroy(GTK_WIDGET(menu));
- g_object_set_data(G_OBJECT(mi), data_menu, NULL);
+ g_object_steal_data(G_OBJECT(mi), data_menu);
}
}
@@ -1024,11 +1006,10 @@ new_item_normal (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusmenu
GtkMenuItem * gmi;
gmi = GTK_MENU_ITEM(g_object_new(GENERICMENUITEM_TYPE, NULL));
- gtk_menu_item_set_label(gmi, dbusmenu_menuitem_property_get(newitem, DBUSMENU_MENUITEM_PROP_LABEL));
if (gmi != NULL) {
+ gtk_menu_item_set_label(gmi, dbusmenu_menuitem_property_get(newitem, DBUSMENU_MENUITEM_PROP_LABEL));
dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
- g_object_unref(gmi);
} else {
return FALSE;
}
diff --git a/libdbusmenu-gtk/menu.c b/libdbusmenu-gtk/menu.c
index 0b31069..236a596 100644
--- a/libdbusmenu-gtk/menu.c
+++ b/libdbusmenu-gtk/menu.c
@@ -329,6 +329,18 @@ remove_child_signals (gpointer data, gpointer user_data)
return;
}
+/* Handler for all of the menu items on a root change to ensure that
+ the menus are hidden before we start going and deleting things. */
+static void
+popdown_all (DbusmenuMenuitem * mi, gpointer user_data)
+{
+ GtkMenu * menu = dbusmenu_gtkclient_menuitem_get_submenu(DBUSMENU_GTKCLIENT(user_data), mi);
+ if (menu != NULL) {
+ gtk_menu_popdown(menu);
+ }
+ return;
+}
+
/* When the root menuitem changes we need to resetup things so that
we're back in the game. */
static void
@@ -344,6 +356,8 @@ root_changed (DbusmenuGtkClient * client, DbusmenuMenuitem * newroot, DbusmenuGt
g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_moved, menu);
g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_delete, menu);
+ dbusmenu_menuitem_foreach(priv->root, popdown_all, client);
+
g_object_unref(priv->root);
priv->root = NULL;
}
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index c627854..4972856 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -87,6 +87,9 @@ static gboolean item_handle_event (DbusmenuMenuitem * item,
static void widget_notify_cb (GtkWidget * widget,
GParamSpec * pspec,
gpointer data);
+static void widget_add_cb (GtkWidget * widget,
+ GtkWidget * child,
+ gpointer data);
static gboolean should_show_image (GtkImage * image);
static void menuitem_notify_cb (GtkWidget * widget,
GParamSpec * pspec,
@@ -169,6 +172,8 @@ parse_data_free (gpointer data)
g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
0, 0, NULL, G_CALLBACK(widget_notify_cb), NULL);
g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL, G_CALLBACK(widget_add_cb), NULL);
+ g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
0, 0, NULL, G_CALLBACK(accel_changed), NULL);
g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
0, 0, NULL, G_CALLBACK(checkbox_toggled), NULL);
@@ -462,8 +467,8 @@ construct_dbusmenu_for_widget (GtkWidget * widget)
if (GTK_IS_SEPARATOR_MENU_ITEM (widget) || !find_menu_label (widget))
{
dbusmenu_menuitem_property_set (mi,
- "type",
- "separator");
+ DBUSMENU_MENUITEM_PROP_TYPE,
+ DBUSMENU_CLIENT_TYPES_SEPARATOR);
visible = gtk_widget_get_visible (widget);
sensitive = gtk_widget_get_sensitive (widget);
@@ -605,6 +610,11 @@ construct_dbusmenu_for_widget (GtkWidget * widget)
G_CALLBACK (widget_notify_cb),
mi);
+ g_signal_connect (widget,
+ "add",
+ G_CALLBACK (widget_add_cb),
+ mi);
+
return mi;
}
@@ -962,6 +972,26 @@ item_handle_event (DbusmenuMenuitem *item, const gchar *name,
return FALSE; // just pass through on everything
}
+static gboolean
+handle_first_label (DbusmenuMenuitem *mi)
+{
+ ParserData *pdata = g_object_get_data (G_OBJECT (mi), PARSER_DATA);
+ if (!pdata->label)
+ {
+ /* GtkMenuItem's can start life as a separator if they have no child
+ * GtkLabel. In this case, we need to convert the DbusmenuMenuitem from
+ * a separator to a normal menuitem if the application adds a label.
+ * As changing types isn't handled too well by the client, we delete
+ * this menuitem for now and then recreate it
+ */
+ DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent (mi);
+ recreate_menu_item (parent, mi);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
widget_notify_cb (GtkWidget *widget,
GParamSpec *pspec,
@@ -981,20 +1011,11 @@ widget_notify_cb (GtkWidget *widget,
}
else if (pspec->name == g_intern_static_string ("label"))
{
- ParserData *pdata = g_object_get_data (G_OBJECT (child), PARSER_DATA);
- if (!pdata->label)
+ if (handle_first_label (child))
{
- /* GtkMenuItem's can start life as a separator if they have no child
- * GtkLabel. In this case, we need to convert the DbusmenuMenuitem from
- * a separator to a normal menuitem if the application adds a label.
- * As changing types isn't handled too well by the client, we delete
- * this menuitem for now and then recreate it
- */
- DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent (child);
- recreate_menu_item (parent, child);
return;
}
-
+
dbusmenu_menuitem_property_set (child,
DBUSMENU_MENUITEM_PROP_LABEL,
g_value_get_string (&prop_value));
@@ -1066,6 +1087,15 @@ widget_notify_cb (GtkWidget *widget,
g_value_unset (&prop_value);
}
+static void
+widget_add_cb (GtkWidget *widget,
+ GtkWidget *child,
+ gpointer data)
+{
+ if (find_menu_label (child) != NULL)
+ handle_first_label (data);
+}
+
/* A child item was added to a menu we're watching. Let's try to integrate it. */
static void
child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data)