| The E.g. |
| If I understand what you want to do, you would have to have some keyword in order to do this anyway. I suppose you would want something like Or something similar if you have one graphics object with many primitives that you want to add one at a time. The problem is of course getting You need this because most graphics objects do not acquire a zorder immediately, though some do in their options decorator. (That is something that could eventually be unified...) If you think that this is useful enough for everyone, we could open a ticket for making it easier. |
| kcrisman's second approach, basically fixing the zorder after the fact, makes the most sense to me. Simply add as you like and then set the zorders from the order in the G list before printing. (I don't think G does any reshuffling, although I could be wrong about that.) Whatever you do, don't do this.
Umm, I'm not sure whether this was sarcastic. I agree that one doesn't want to mess with double-underscore methods lightly, but maybe I'm missing some pop-culture reference here? We do use decorators all the time, which is basically what you are doing here, right?
kcrisman (Dec 24 '10)
There's no sarcasm at all on my end: monkeypatching is fun but when I don't understand the underlying code -- and here I don't -- it's simply a good way to have weird and hard-to-diagnose bugs show up. For example, I have no idea if some plotting routine depends on the zorders not being changed while it's working. Probably not, but those are dangerous assumptions to make, and I've burned myself in the past.. Fixing the zorder externally is both simpler and safer.
DSM (Dec 24 '10) |
Asked: Dec 22 '10
Seen: 94 times
Last updated: Dec 22 '10
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.