[FIXED] Re: [PATCH] fix broken api of Gtk2::TreeSelection->get_selected() [gtk2-perl regression]

Thierry Vignaud said:
muppet <scott asofyet org> writes:
Thierry Vignaud said:
unlike C and gtk2-perl APIs, Gtk2::TreeSelection->get_selected()
return its return values in the wrong order.

nobody spoke up to oppose, so i just fixed this in CVS.

to sum up, $tree_selection->get_selected returns its arguments in reverse
(correct per the C API reference) order in list context, and still returns
just the iter in scalar context.

  # list context:
  ($model, $iter) = $tree_selection->get_selected;

  # scalar context:
  $iter = $tree_selection->get_selected;

this change has the potential to break your code, as you'll probably see after
updating either to CVS or to the next version (0.28, when it comes out).  if
you were using the scalar context, you should be unaffected.  if your code
breaks in scalar context, let me know, because that means i did something

muppet <scott at asofyet dot org>

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