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?
Not necessarily; the SPView could maintain a stack of messages, and simply notify observers via the signal when the top of its message stack changes.
But GTK already has the stack of statusbar messages, why duplicate it? I think it's better to make two signals instead, one for push and one for pop.
On the other hand, wait a minute. You have explained why we need to go to SPView in order to set statusbar. But why SPView has to send signals? This only makes sense if there may be more than one listener; but do we want different document windows to display the same message, even if they show the same document? I think not. Messages are always displayed in the window where the things happen. So maybe we can handle this without signals, i.e. get directly from the selection (or whatever else issues the current message) to its desktop widget?
Right now, given the current desktop, you need to look at SP_NODE_CONTEXT (desktop->event_context)->nodepath->selection to get a GSList of the selected nodes.
By the way, now it's GList, not GSList :) I changed that some time ago to do tab-cycling back and forward in a more natural way.
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.
My experience with using global variables over the years is that they DON'T make code more usable for developers (I use the term "maintainable"), in the long run.
Hey, actually my favorite programming language is XSLT, so you don't need to explain that to me :) And I was not advocating using globals, only making function calls as short and simple as possible.
The button actions should have been created on a per-desktop basis, rather than having a shared set that all used SP_ACTIVE_DESKTOP. However, fixing that requires a major reorganization of parts of the codebase.
OK, I promise to never use SP_ACTIVE_DESKTOP anymore :) Instead I will create several functions that accept different kinds of "current things" (such as selection, event context, desktop) and do different ->...->...-> chains to always arrive at the desktop widget that corresponds to that argument object (if possible, without signals). Then in different parts of the code I'll have to call different functions, depending on what object I have at hand. Would you approve of that plan?
Otherwise the chances of errors will increase because people (like me :) will have to copy obscure bits around without fully understanding them.
I don't want to stymie you, since you do really exceptional UI work -- just, for now I would prefer that you copy the bits of indirect code (maybe shifting them into helper functions for your own use), and in your own new code try to stick with passing things as parameters rather than using globals as much as possible.
I'm not against passing parameters; I just want these parameters to be logical and short, with the fuiction itself doing all the ->->-> instead of me :)
P.S. Have you tried my "black magic" bug? I have even recompiled it with -O1 but that did not help :( Do you think I can commit the g_print "fix" with appropriate comments (well, at least it's guaranteed not to break anything)?
_________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2...