
For example, I want a function for temporary displays that are pushed
and then
popped after some timeout. This means the statusbar signal must be split
in
two, or at least given extra arguments. Is this the right approach?
I would prefer that you implement the push/pop/timeout behavior and API in SPView, perhaps supplementing or replacing sp_view_set_status().
The signal itself should not need to change.
Wouldn't we need to have at least two signals for pushing and popping?
For example, in sp_selection_update_statusbar() in selection.c:
sp_view_set_status (SP_VIEW (SP_ACTIVE_DESKTOP), message, TRUE);
What happens if SP_ACTIVE_DESKTOP is not the desktop that the selection object is attached to? What if it's a desktop for an entirely different document. This won't normally happen (yet), but it could in the future.
There is no need for the extra indirection anyway. An SPSelection knows which desktop it is from; this should be:
sp_view_set_status (SP_VIEW (selection->desktop), message, TRUE);
OK, but what if there's no selection currently? And what if I want to update statusbar in the node editor? Its idea of selection is different (nodes). Perhaps I can still access selector's selection in node edit, but I haven't tried yet; can it be done in a simple fashion that would work everywhere? E.g. a global variable that always points to the current selection?
You know, being a usability freak, I care about usability not only for users but for coders too. I think that the coder should not be forced to provide anything but the obviously necessary information for each task. Otherwise the chances of errors will increase because people (like me :) will have to copy obscure bits around without fully understanding them.
So, I would prefer to have a function like set_statusbar_of_selection("message") that would figure out the active selection, go to its desktop, send signal, etc. In those rare cases where a message is not logically attached to a selection, another function would be used where you must also provide an SPView object. Is this feasible? How to reliably figure out current selection, and what to do if it's NULL?
_________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2f...