[10453] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Interesting problem?

daemon@ATHENA.MIT.EDU (Rostedt, Steven)
Wed Nov 25 16:29:41 1998

Date: Wed, 25 Nov 1998 16:29:07 -0500
From: "Rostedt, Steven" <steven.rostedt@lmco.com>
To: "'GTK-List'" <gtk-list@redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

 
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

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post