3 Jul 15:45
unintended notification recursion
Hi folks, It seems I've coded myself into a corner. See the attached partial screenshot of a panel from my Chaco-based application. The various controls determine how a 2D dataset is binned into a colormapped image. The point is to allow the user to choose the number of bins, image boundaries, etc. The problem is that the user's input for one trait has to change some of the other traits, which triggers the notification handler in an endless loop. I'm using extended traits names to register the handlers. This works fine for the group labeled Filtering, but none of those traits depend on each other. In the X and Y Imaging groups, changing the binning boundaries for a fixed number of bins, for example, changes the bin size. Each time the handler tries to adjust one of these traits attributes, it gets called again, and I end up in an endless loop. In hindsight, this should have been an obvious problem. What's less obvious to me is how I can get around it. I've tried "unhooking" the handler with the remove=True keyword in on_trait_change within the handler, but that didn't work. Any advice would be very welcome! If none of this makes any sense, I can send a code snippet, but I'm pressed for time just before a trip and was hoping someone had a quick solution. Thanks! Zaven p.s. Thanks, Fred and Robert, for your responses to my earlier question about reflecting plot limits in my view...
_______________________________________________ Enthought-Dev mailing list Enthought-Dev@... https://mail.enthought.com/mailman/listinfo/enthought-dev
RSS Feed