Re: unset default row in a treeview (treesort)



"Kevin Ryde" <user42 zip com au> wrote:
Oh, a set_cursor() under a "cursor-changed" might immediately recurse to
run "cursor-changed again.  Perhaps clear the $start_init before doing
the set_cursor().  Assuming a set_cursor() is in fact what you want!

Are you sure you don't want to make the initial selection and/or cursor
position when first setting in a model?  Or when the model is first
populated?

Aaah great! Yes you're right :D
with
sub on_theme_center_options_treeview_cursor_changed()
{
 :
 if ($start_init == FALSE)
 {
 :
 }
 else
 {
 $start_init = FALSE;
 # set 10th row in ThemeCenter list -> Theme manager
 &set_treeview_row($treeview_object, "Theme Manager");
 $selected_row = $theme_center_list_hash{"Theme Manager"};
 }

and

sub set_treeview_row($$)
{
 :
 my $treeiter = $tree_model->get_iter_from_string($row_path);
 &dprint(" treeiter: $treeiter\n");
 my $treepath = $tree_model->get_path ($treeiter);
 &dprint(" treepath: $treepath\n");
 $tree_view_object->set_cursor ($treepath, undef, FALSE);
}   

it works like a charme!!!

Thank you very much!!
--Thomas
___________________________________________________________
Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02



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