Okay, here's the second half of my thinking on the statusbar stuff.
Basically, a class that looks something like this:
class StatusMessageContext { public: StatusBarContext(SPView *view) : _view(view), _message_id(NULL_MESSAGE_ID) { g_object_ref(G_OBJECT(_view)); } ~StatusBarContext() { cancel(); g_object_unref(G_OBJECT(_view)); } void post(StatusMessageType type, gchar const *message) { cancel(); _message_id = _view->postStatusMessage(type, false, message); } void flash(StatusMessageType type, gchar const *message) { _view->postStatusMessage(type, true, message); } void cancel() { if (_message_id) { _view->cancelStatusMessage(_message_id); _message_id = NULL_MESSAGE_ID; } } void postF(StatusMessageType type, gchar const *format, ...) { ... etc ... } void flashF(StatusMessageType type, gchar const *format, ...) { ... etc ... } private: SPView *_view; StatusMessageID _message_id; };
The idea being that everybody can have their own StatusMessageContext (e.g. a SPSelectContext has one, and a seltrans has one, etc..). Then they can simply pretend they have the statusbar all to themselves, but it will do the right thing for all concerned behind the scenes.
Comments?
-mental
participants (1)
-
MenTaLguY