GtkItemFactory/Builder bug?



I get this error message when running the attached script.

GLib-GObject-WARNING **: invalid cast from `GtkIconFactory' to `GtkBuildable' at bug.pl line 12. Gtk-CRITICAL **: gtk_buildable_custom_tag_start: assertion `GTK_IS_BUILDABLE (bu ildable)' failed at bug.pl line 12. Unhandled tag: 'sources' at bug.pl line 12.
it is dieing on the sources tag

   <interface>
       <object class="GtkIconFactory" id="MyIconFactory">
           <sources>   <--------
               <source stock-id="my-comment" filename="comment.png"/>
           </sources>
       </object>
</interface>

This is the syntax outlined in the documentation:

http://library.gnome.org/devel/gtk/stable/gtk-Themeable-Stock-Images.html#gtk-Themeable-Stock-Images.implemented-interfaces

The documentation points out the special sources tag...

Am I just missing something here or is this a bug. Is the problem in gtk-perl or Gtk or just my setup? I am running camelbox on vista.

Thank you! :-)
#
#  produces this error message:
#
#  GLib-GObject-WARNING **: invalid cast from `GtkIconFactory' to `GtkBuildable' at
#   bug.pl line 12.                                                                
#  Gtk-CRITICAL **: gtk_buildable_custom_tag_start: assertion `GTK_IS_BUILDABLE (bu
#  ildable)' failed at bug.pl line 12.                                             
#  Unhandled tag: 'sources' at bug.pl line 12.                                     
#

#!/usr/bin/perl -w
use strict;
use warnings;


use Gtk2 '-init';

# load in the custom icon set
my $builder = Gtk2::Builder->new;
$builder->add_from_string(qq[
    <interface>
        <object class="GtkIconFactory" id="MyIconFactory">
            <sources>
                <source stock-id="my-comment" filename="comment.png"/>
            </sources>
        </object>
    </interface>
]);

my $item_factory = $builder->get_object('MyIconFactory');

my $window = Gtk2::Window->new;
my $button = Gtk2::Button->new_from_stock('my-comment');
$window->add($button);
$window->show_all;

$window->signal_connect('delete-event' => sub { Gtk2->main_quit });

Gtk2->main;




PNG image



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