[perl-Gtk2] Gtk2::ToolItem->set_proxy_menu_item(): allow undef for menu_item



commit 71146bf47b93a9069892e0cd602cf42c7b567900
Author: Kevin Ryde <user42 zip com au>
Date:   Sat Jan 15 06:42:43 2011 +1100

    Gtk2::ToolItem->set_proxy_menu_item(): allow undef for menu_item
    
    https://bugzilla.gnome.org/show_bug.cgi?id=639557

 t/GtkToolItem.t   |    8 ++++++--
 xs/GtkToolItem.xs |    7 +++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/t/GtkToolItem.t b/t/GtkToolItem.t
index 5f5a480..71e20bf 100644
--- a/t/GtkToolItem.t
+++ b/t/GtkToolItem.t
@@ -5,7 +5,7 @@
 
 use Gtk2::TestHelper
 	at_least_version => [2, 4, 0, "Action-based menus are new in 2.4"],
-	tests => 23;
+	tests => 24;
 
 
 my $tool_item = Gtk2::ToolItem->new;
@@ -64,6 +64,10 @@ is ($tool_item->get_toolbar_style, 'icons');
 is ($tool_item->get_relief_style,  'none');
 
 
+$tool_item->set_proxy_menu_item ("menu_item_id", undef);
+is ($tool_item->get_proxy_menu_item ("menu_item_id"), undef,
+   'set_proxy_menu_item() to undef');
+
 my $menu_item = Gtk2::MenuItem->new;
 $tool_item->set_proxy_menu_item ("menu_item_id", $menu_item);
 is ($tool_item->retrieve_proxy_menu_item, $menu_item);
@@ -110,5 +114,5 @@ SKIP: {
 
 __END__
 
-Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for the
+Copyright (C) 2003-2005, 2011 by the gtk2-perl team (see the file AUTHORS for the
 full list).  See LICENSE for more information.
diff --git a/xs/GtkToolItem.xs b/xs/GtkToolItem.xs
index 972f6bb..e0e8311 100644
--- a/xs/GtkToolItem.xs
+++ b/xs/GtkToolItem.xs
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 by the gtk2-perl team (see the file AUTHORS)
+ * Copyright (c) 2003, 2011 by the gtk2-perl team (see the file AUTHORS)
  *
  * Licensed under the LGPL, see LICENSE file for more information.
  *
@@ -60,7 +60,10 @@ GtkWidget * gtk_tool_item_retrieve_proxy_menu_item (GtkToolItem *tool_item);
 
 GtkWidget * gtk_tool_item_get_proxy_menu_item (GtkToolItem *tool_item, const gchar *menu_item_id);
 
-void gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item, const gchar *menu_item_id, GtkWidget *menu_item);
+# Crib: menu_item can be NULL here for no menu item.
+# Docs of gtk_tool_item_set_proxy_menu_item() don't say so explicitly, but the
+# docs of create-menu-proxy signal invite handlers to set NULL for no menu.
+void gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item, const gchar *menu_item_id, GtkWidget_ornull *menu_item);
 
 #if GTK_CHECK_VERSION (2, 6, 0)
 



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