[perl-Gtk3] Add overrides for Gtk3::Widget::render_icon



commit ba262e6741afbfb6eb141d2afdd8b34d2253d535
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sat Dec 7 00:53:09 2013 +0100

    Add overrides for Gtk3::Widget::render_icon
    
    Based on a patch by Thierry Vignaud.

 NEWS          |    1 +
 lib/Gtk3.pm   |    7 +++++++
 t/overrides.t |    9 ++++++++-
 3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 61b58c8..00426b0 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@
 * Add overrides for Gtk3::RadioAction, Gtk3::RadioButton, Gtk3::RadioMenuItem
   and Gtk3::RadioToolButton.
 * Add an override for Gtk3::SizeGroup::get_widgets.
+* Add an override for Gtk3::Widget::render_icon.
 * Add an override for Pango::Layout::set_text.
 * Require Test::Simple >= 0.96.
 
diff --git a/lib/Gtk3.pm b/lib/Gtk3.pm
index bfca557..065957b 100644
--- a/lib/Gtk3.pm
+++ b/lib/Gtk3.pm
@@ -1309,6 +1309,13 @@ sub Gtk3::VBox::new {
     $_GTK_BASENAME, 'VBox', 'new', $class, $homogeneous, $spacing);
 }
 
+sub Gtk3::Widget::render_icon {
+  my ($widget, $stock_id, $size, $detail) = @_;
+  Glib::Object::Introspection->invoke (
+    $_GTK_BASENAME, 'Widget', 'render_icon', $widget, $stock_id,
+    $_GTK_ICON_SIZE_NICK_TO_ID->($size), $detail);
+}
+
 sub Gtk3::Window::new {
   my ($class, $type) = @_;
   $type = 'toplevel' unless defined $type;
diff --git a/t/overrides.t b/t/overrides.t
index 8b6f071..371f0ee 100644
--- a/t/overrides.t
+++ b/t/overrides.t
@@ -7,7 +7,7 @@ use warnings;
 use utf8;
 use Encode;
 
-plan tests => 163;
+plan tests => 164;
 
 # Gtk3::CHECK_VERSION and check_version
 {
@@ -528,6 +528,13 @@ __EOD__
   isa_ok ($menubars[1], "Gtk3::MenuBar");
 }
 
+# Gtk3::Widget
+{
+  my $widget = Gtk3::Label->new ("Test");
+  isa_ok ($widget->render_icon ("gtk-open", "menu", "detail"),
+          "Gtk3::Gdk::Pixbuf");
+}
+
 # Gtk3::Gdk::Atom
 SKIP: {
   skip 'atom stuff; missing annotations', 2


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