moving nodes in a tree

2007-06-22 Thread Dave Howorth
I'm trying to use $tree_store->move_after ($iter, $position) and
$tree_store->move_before ($iter, $position) and am getting errors like
this:  Gtk-WARNING **: Given children are not in the same level

but I've called $tree_store->iter_depth ($iter) on both arguments
immediately before calling the move methods and I get the same numerical
result for both. i.e.

$model->iter_depth($source_iter) => 4
$model->iter_depth($destination_iter) => 4
$model->move_after($source_iter, $destination_iter)
  => Gtk-WARNING **: Given children are not in the same level

Am I misunderstanding the docs, or is there some other gotcha?

Module version 1.144
Built for gtk+ 2.6.4
Running with gtk+ 2.6.4

Cheers, Dave
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: moving nodes in a tree

2007-06-22 Thread Dave Howorth
As I wasn't getting anywhere using move_before/after I decided to try
using the drag/drop interface instead. Sadly I'm not having much luck
there either. I write:

  my $source_path = $model->get_path($source_iter);
  my $draggable = $model->row_draggable($source_path);
  my $selection_data = $model->drag_data_get($source_path);

  warn "source_path=".$source_path->to_string."\n";
  warn "draggable=$draggable\n";
  warn "selection_data=$selection_data\n";

and I get:

  source_path=0:0:0:1:0
  draggable=1
  Use of uninitialized value in concatenation (.) or string at
  ./scop-tree-editor.pl line 768.
  selection_data=

What am I doing wrong there?

$model isa TreeStore and the view is showing well-defined data on screen
and other code can access the row data successfully with get().


BTW, further to my previous mail:
> I'm trying to use $tree_store->move_after ($iter, $position) and
> $tree_store->move_before ($iter, $position)

I've also noticed that the Perl interface won't let me have $position be
undef, which is documented as OK in the C interface (NONE) and the
Python interface (None).

I haven't managed to find any examples for any of these features.

Cheers, Dave
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: moving nodes in a tree

2007-06-22 Thread Roderich Schupp
On 6/22/07, Dave Howorth <[EMAIL PROTECTED]> wrote:
> I'm trying to use $tree_store->move_after ($iter, $position) and
> $tree_store->move_before ($iter, $position) and am getting errors like
> this:  Gtk-WARNING **: Given children are not in the same level

Looking at the Gtk sources, AFAICT they check not only for the
same level, but that $iter and $position are actually siblings.

Cheers, Roderich
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: moving nodes in a tree

2007-06-22 Thread Torsten Schoenfeld
On Fri, 2007-06-22 at 15:03 +0100, Dave Howorth wrote:

> > I'm trying to use $tree_store->move_after ($iter, $position) and
> > $tree_store->move_before ($iter, $position)
> 
> I've also noticed that the Perl interface won't let me have $position be
> undef, which is documented as OK in the C interface (NONE) and the
> Python interface (None).

That's a bug.  Fixed in the stable branch and HEAD of CVS.

-- 
Bye,
-Torsten

___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Gtk2-1.152?

2007-06-22 Thread Thierry Vignaud
Torsten Schoenfeld <[EMAIL PROTECTED]> writes:

> > Will there be a Gtk2-1.152 with all the recently binded widgets?
> > I would like to start testing and using the new Gtk+ widgets in
> > our tools.
> 
> We've all been very busy lately, it seems.  But I promise to do a
> release not later than the coming weekend.  Unless someone beats me
> to it, of course. :-)

Thx you very much :-) !
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list