Re: Method get_active_iter of ComboBox

Many thanks, it solved my problem.

And it prompted me to use perldoc on an Ubuntu virtual machine as  there is'nt any Gtk related documentation on Strawberry Perl, my primary development environment.



Le ven. 14 janv. 2022 à 13:00, <gtk-perl-list-request gnome org> a écrit :

Message: 1
Date: Thu, 13 Jan 2022 21:30:52 +0100
From: Torsten Schoenfeld <torsten schoenfeld gmx de>
To: gtk-perl-list gnome org
Subject: Re: Method get_active_iter of ComboBox
Message-ID: <b28d6b3f-94ed-50f2-9f3c-d2712615c3ec gmx de>
Content-Type: text/plain; charset=utf-8; format=flowed

On 04.01.22 23:35, Kerenoc Kerenoc via gtk-perl-list wrote:
> I'd like to know how to test the result of get_active_iter() when no
> element is active.In Gtk2 it returns undef but in Gtk3 it returns a
> Gtk3::TreeIter object that isn't usable.

Apparently, we never added an overload for it to make it behave like in
Gtk2, so you can ask perli11ndoc how to use it:

# perli11ndoc Gtk3::ComboBox::get_active_iter

   Gtk3::ComboBox::get_active_iter [available since 2.4]


   ($retval, $iter) = $object->get_active_iter ()




   ? gboolean
     %TRUE if @iter was set, %FALSE otherwise

   ? iter: Gtk3::TreeIter
     A #GtkTreeIter

Use the bool $retval to know whether $iter is valid.


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