builder on scalar properties

If an object property is a Glib::Scalar, ie. Glib::ParamSpec->scalar,
can it be set with the <property> thingie in Gtk2::Builder ?  The few
lines below get

    Gtk-WARNING **: Failed to set property Foo.myscalar to "hello": Could not parse '"hello"' as a GPerlSV at 
/tmp/ line 21.

and apparently don't set the property.

use strict;
use warnings;
use Gtk2;

  package Foo;
  use strict;
  use warnings;
  use Glib;
  use Glib::Object::Subclass
      properties => [Glib::ParamSpec->scalar

my $builder = Gtk2::Builder->new;
$builder->add_from_string (<<'HERE');
  <object class="Foo" id="myfoo">
    <property name="myscalar">"hello"</property>

my $foo = $builder->get_object('myfoo');
print $foo,"\n";
print $foo->get('myscalar')||'[undef]',"\n";

exit 0;

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