Re: [gtk-list] selection_changed signal in gtktree widget



> 
> I'm getting behavior where if a treeitem is already selected
> (ie - I've previously selected and it looks blue), and I
> select it again with button 1, I get two selection_changed
> signals.  When handling the first one the selection is empty,
> and when handling the second one it contains the selection
> as expected.
> 
> If I select a different item, I only get one selection_changed
> signal, and the selection is as expected.
> 
> Is this the correct behavior?
> 
Hi,

Not this isn't the correct behavior.

There is a bug in the selection function. A break statement is missing.
This is will be corrected in next patch for gtktree.

But you can correct this easily.
Edit gtktree.c.
In the function gtk_real_tree_select_child, add a break statement at
the end of the case GTK_SELECTION_SINGLE, just before case GTK_SELECTION_BROWSE

      gtk_signal_emit (GTK_OBJECT (tree->root_tree), 
		       tree_signals[SELECTION_CHANGED]);
>>      break;


    case GTK_SELECTION_BROWSE:
      selection = root_selection;


Regards,

-- 
-----------------------------------------------------------------------
    _/ _/_/  _/  _/_/   _/_/_/ _/_/_/ Bolliet Jerome
   _/ _/ _/ _/ _/  _/   /  _/     _/  email: bolliet@in2p3.fr
  _/ _/  _/_/    _/   _/_/_/   _/_/   
 _/ _/    _/   _/    _/         _/    Equipe Administration Systeme
_/ _/    _/  _/_/_/ _/     _/_/_/     email: sysunix@in2p3.fr
Centre de Calcul - Campus de la Doua
  27 boulevard du 11 novembre 1918    Tel.: 04 78 93 08 80
   69622 - VILLEURBANNE - FRANCE      Fax.: 04 78 94 30 54
-----------------------------------------------------------------------



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