SimpleList and selection callbacks



Things were going well until I needed to change my list from using a
double-click to a single-click to make things happen.  What I want to
do is pretty simple, and works if I use the 'row_activated' signal:

1) Read a text file and make a SimpleList out of each line.
2) Set the current selection in this list according to complex criteria.
3) When the users makes a list selection, do file related some stuff.
4) Reread a bunch of files, including the original text file, and repeat.

The problem I have is that I can't distinguish between a programmatic
list selection (#2) and a user initiated list selection (#3).  As a
result, I currently fail with a "deep recursion" error message.  

There must be some way to distinguish these two events, right?

Does it maybe have to do with some difference between
set_select_function() and the 'changed' signal?  Or is there some way
to learn what caused the 'changed' signal?  Or some other signal that
I can hook up to?  I suppose I could just set and unset the 'changed'
handler before and after I do the programmatic selection :(

Hating the entire MVC approach (which I realize is not your fault),

--nate






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