[Glade-users] signal loop problem

Jason LaPenta wrote:


I have a widget A and a widget B. When a user
edits widget A the signal handler sets some
widget B data. When the user in turn modifies
widget B, the B signal handler sets widget A
data. Now I run into a problem because setting
the widget causes a signal to be called... which
dumps me into a loop between signal... bad.

How do I keep this from happening?


 o block the signals as James said.
 o set a variable like 'updating_widgets', and in your signal
   handlers check for that and just return if it is set.


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