Re: unset default row in a treeview (treesort)



"Dave Howorth" <dhoworth mrc-lmb cam ac uk> wrote:
It sounds like you perhaps aren't allowing the program to process
events? After you call select_iter how is control passed back to the
event loop?

I don't know how to do it ... I red many tuts but I don't understand how to implement this.
As the program starts the event "cursor-changed" occurs, so I implemented this event in my sub
sub theme_center_options_treeview()
{
       :
   # create a treeview, specify $tree_store as its model
   my $tree_view = Gtk2::TreeView->new($tree_store);
   $object{'theme_center_options_treeview'} = $tree_view;
   $tree_view->signal_connect("cursor-changed" => \&on_theme_center_options_treeview_cursor_changed);

   # create a Gtk2::TreeViewColumn to add to $tree_view
       :
}

In the callback sub I check if the event occurs at start time or later when a row will be clicked:
sub on_theme_center_options_treeview_cursor_changed()
{
   my $treeview_object = $object{'theme_center_options_treeview'};
   my $selected_row;
 
   if ($start_init == FALSE)
   {
     my $treeselection = $treeview_object->get_selection();
     $selected_row = get_treeview_row(\$treeselection);
   }
   else
   {
     my $treeselection = &set_treeview_row($treeview_object, "Theme Manager");
     $start_init = FALSE;
   }
}

By checking the Gtk2::tree*** modules I found in Gtk2::TreeModel
$tree_model->row_changed ($path, $iter)
so I tried
   $treeselection->select_iter($treeiter);
   $tree_model->row_changed ($treepath, $treeiter);
but it doesn't help :-(
___________________________________________________________
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]