Interesting problem?



 
Scenario: I have two Clists with different content in the rows.
  I'm using GTK+ 1.0.6

If you double click (GTK_2BUTTON_PRESSED) on one of the lists
it swaps the content of the two lists and reselects the items
that were originally selected. (in theory)

Problem:  This "swap" is performed in the call back of GTK_2BUTTON_PRESSED
  from one of the lists.  It fills the other list correctly, then fills the
current list
  and selects the item appropriately. BUT THEN it selects the item 
  at the index that had
  the original double click (on the list that the clicking was performed
on).

It seems that the double click causes two signals to be performed.
One calling the GTK_2BUTTON and the other that is attached to
the select row for the CList.  Since the button selection is performed first
and the swap is made, but then the second call is performed reselecting
the item (if any) at the position of the double click.

I would turn off the signal but since all swapping is done inside the
callback
the signal is already set to be done after the call back is finished, so
I don't know how to turn the single handling back on. 
In other words, I need to surpress this "selection of the row" ONLY for 
a double click.

Right now I'm using a static global that lets me know of this situation 
and to reselect the correct item "again!".

Is there a better way?

Thanks,
Steve



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