Prolems with liststore insert_with valuesv

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Prolems with liststore insert_with valuesv

Mike Martin-12
Hi
I am trying to use insert_with_valuesv to populate a liststore as follws

my ($resultmodel,$result)=@_;
    no strict 'refs';
    #print $resultmodel;
    my @cols=0 .. scalar @{$result->[0]} -1;

    foreach my $f (@{$result}){

    my $iter=$resultmodel->insert_with_valuesv(-1,\@cols,$f);
}
$result is an arrayref passed to the sub and resultmodel is the liststore

Unfortunately I am getting 'Cannot convert arbitrary SV to GValue' with I assume $f which is an array ref
As far as I can see this should work
Any ideeas what I am doing wrong?


_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Prolems with liststore insert_with valuesv

Mike Martin-12
partial answer to my own question if I replace insert_with_valuesv to insert_with_values it works

On 7 August 2017 at 17:35, Mike Martin <[hidden email]> wrote:
Hi
I am trying to use insert_with_valuesv to populate a liststore as follws

my ($resultmodel,$result)=@_;
    no strict 'refs';
    #print $resultmodel;
    my @cols=0 .. scalar @{$result->[0]} -1;

    foreach my $f (@{$result}){

    my $iter=$resultmodel->insert_with_valuesv(-1,\@cols,$f);
}
$result is an arrayref passed to the sub and resultmodel is the liststore

Unfortunately I am getting 'Cannot convert arbitrary SV to GValue' with I assume $f which is an array ref
As far as I can see this should work
Any ideeas what I am doing wrong?



_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Loading...