On Wed, 2007-10-31 at 15:04 +0200, Bernd Jendrissek wrote: > I have a patch that needs to renumber pinnumber attributes, which I > used to do in libgeda, using o_redraw_single. But now that interface > is in gschem, and I don't know how else to rewrite the attributes from > within libgeda. > > Ideally there'd be some sort of Observer pattern, but for now > something else will have to do. I've seen some code do ->CHANGED = 1; > is this my best option?
Am aware of the observer pattern stuff, certainly, and this is the way I hope things will go. (And is what I'm going to work towards). The move was made to push all drawing code and related variables into gschem (where they arguably belong), o_redraw_single actually had very little use in libgeda. My offer to fix up anyone's outstanding patches still stands, however I don't have time to do it at the moment. ->CHANGED = 1; (off the top of my head) I think relates to the dirty state of pages, so the program will complain about needing to save if you try to quit. I think the best option for now, (if applicable) is to move the code to redraw after your renumber operation into gschem (or the whole lot). The current pattern (which isn't great), is that gschem invokes actions, and "knows" what objects it should redraw afterwards. The main case if libgeda modifying things without gschem's explicit request is net consolidation. Bizarrely, this happens as a side-effect of saving undo-state. As expected, without a proper observer pattern, this can leave artifacts from line grips / cues in some cases. Peter _______________________________________________ geda-dev mailing list [email protected] http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev
