On Sun, 2004-05-02 at 22:20, bulia byak wrote:
I also want to preserve the current pop function (popping whatever is at the top of the stack without an id) as well, because in many situations (such as dragging or navigating in menu) there's really no need to fiddle with ids. That would be extra work for no extra benefit, for in these cases nothing can conceivable overlay the message that you just pushed up.
I'm not sure I agree ... with dragging at least, warning/notification messages might get displayed by other code. Code using pop() is making a global assumption that's can't be guaranteed[1]. Simple cases can become a lot more complex when underlying code is altered.
I think it's better to provide a simple solution that works in all cases. Have a look at the proposed StatusMessageContext; it should work universally and handle ID tracking automatically.
But let me know if you think of cases where it would be inconvenient. I'm still sketching at this point.
-mental
---
[1] Exercise: could you add an assert() to pop() that would fail if code used pop() to pop a message it did not push?
If not, what API changes would be necessary to provide enough information for the assert()? Those changes would highlight the previously implicit assumptions.