perl-Gtk2 r2109 - in trunk: . t xs
- From: tsch svn gnome org
- To: svn-commits-list gnome org
- Subject: perl-Gtk2 r2109 - in trunk: . t xs
- Date: Tue, 13 Jan 2009 20:45:00 +0000 (UTC)
Author: tsch
Date: Tue Jan 13 20:45:00 2009
New Revision: 2109
URL: http://svn.gnome.org/viewvc/perl-Gtk2?rev=2109&view=rev
Log:
Wrap new GtkImageMenuItem API. Patch by Emmanuel Rodriguez.
Modified:
trunk/ChangeLog
trunk/t/GtkImageMenuItem.t
trunk/xs/GtkImageMenuItem.xs
Modified: trunk/t/GtkImageMenuItem.t
==============================================================================
--- trunk/t/GtkImageMenuItem.t (original)
+++ trunk/t/GtkImageMenuItem.t Tue Jan 13 20:45:00 2009
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 7;
+use Gtk2::TestHelper tests => 11;
# $Id$
@@ -27,6 +27,29 @@
$item -> set_image($image);
is($item -> get_image(), $image);
+SKIP: {
+ skip 'use_stock methods', 4
+ unless Gtk2->CHECK_VERSION(2, 15, 0); # FIXME: 2.16
+
+ # Get an item from a stock and test the getter/setter
+ my $from_stock = Gtk2::ImageMenuItem -> new_from_stock("gtk-yes");
+ is($from_stock -> get_use_stock(), TRUE);
+ $from_stock -> set_use_stock(FALSE);
+ is($from_stock -> get_use_stock(), FALSE);
+
+
+ # Get an item WITHOUT a stock and test the getter/setter
+ my $with_label = Gtk2::ImageMenuItem -> new_with_label("Fake");
+ is($with_label -> get_use_stock(), FALSE);
+ $with_label -> set_use_stock(TRUE);
+ is($with_label -> get_use_stock(), TRUE);
+
+ # Add an accelator (applies only to stock items). Can't be verified, at least
+ # the method call is tested for a crash
+ my $with_accelartor = Gtk2::ImageMenuItem -> new_from_stock("gtk-no");
+ $from_stock -> set_accel_group(Gtk2::AccelGroup -> new());
+}
+
__END__
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
Modified: trunk/xs/GtkImageMenuItem.xs
==============================================================================
--- trunk/xs/GtkImageMenuItem.xs (original)
+++ trunk/xs/GtkImageMenuItem.xs Tue Jan 13 20:45:00 2009
@@ -62,3 +62,25 @@
gtk_image_menu_item_get_image (image_menu_item)
GtkImageMenuItem * image_menu_item
+
+#if GTK_CHECK_VERSION(2, 15, 0) /* FIXME: 2.16 */
+
+## gboolean gtk_image_menu_item_get_use_stock (GtkImageMenuItem *image_menu_item);
+gboolean
+gtk_image_menu_item_get_use_stock (image_menu_item)
+ GtkImageMenuItem * image_menu_item
+
+## void gtk_image_menu_item_set_use_stock (GtkImageMenuItem *image_menu_item, gboolean use_stock);
+void
+gtk_image_menu_item_set_use_stock (image_menu_item, use_stock)
+ GtkImageMenuItem * image_menu_item
+ gboolean use_stock
+
+## void gtk_image_menu_item_set_accel_group (GtkImageMenuItem *image_menu_item, GtkAccelGroup *accel_group);
+void
+gtk_image_menu_item_set_accel_group (image_menu_item, accel_group)
+ GtkImageMenuItem * image_menu_item
+ GtkAccelGroup * accel_group
+
+#endif /* 2.16 */
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]