Re: 'Cannot convert arbitrary SV to GValue' when setting child property of GtkStack



"Daniel Kasak" <d j kasak dk gmail com>:
I'm trying to set the 'needs-attention' property of a GtkStack's child page.

When I go:

use Glib qw( TRUE FALSE );

my $needs_attention = FALSE;

if ( $self->{ 'Column' . $i . 'Datasheet' }->count ) {
    $needs_attention = TRUE;
}

my $child = $self->{stack}->get_child_by_name( 'page' . $i );

$self->{stack}->child_set_property(
    $child
  , 'needs-attention'
  , $needs_attention
);

 ... I get:

Cannot convert arbitrary SV to GValue'

Looks like the Gtk3::Container::child_set* and child_get* methods need overrides.  Fow now, 
child_set_property expects a GValue, so as a workaround, try something like this:

  my $gvalue = Glib::Object::Introspection::GValueWrapper->new (
    'Glib::Boolean', $needs_attention);
  $self->{stack}->child_set_property ($child, 'needs-attention', $gvalue);


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