Re: Setting an iter from an ID value



Quoting Daniel Kasak <dkasak nusconsulting com au>:
 
This works, but doesn't seem like a very economical way of doing
things.  I've thought about getting the string field from the
database and using $widget->get_child->set_text($string) but
that also seems kinda dodgy, and won't work if there are
duplicate strings ( not that there should be, but anyway
... )

Is there a better way of doing this?

I don't think you have too many options.  If you can come up with an
index of the item you want to select, you can use
$model->iter_nth_child(undef, $index) to get the iter you need.
$index starts from 0... I think.  

The solution I'm working towards for my applications is a custom
TreeModel (I seem to be doing a lot of those recently... this will
be my third, when I get around to it).  Unfortunately, it won't be
a viable option for a while yet, if at all, because it requires
a patched Gtk2.  (If anyone's interested, more discussion about
this will likely be coming to the list in the next couple of days.)

Zach

-- 
And I say, Give me back my memory, or I'll rip you into three boy
scouts and a watchband!
                                           ---Aaron in "Remind Me Again"
------------------------------------------------------------------------
Zach Bean, zb forty2 com, web forty2 com           http://www.forty2.com



-- 
And I say, Give me back my memory, or I'll rip you into three boy scouts
and a watchband!
                                           ---Aaron in "Remind Me Again"
------------------------------------------------------------------------
Zach Bean, zb forty2 com, web forty2 com          http://www.forty2.com



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