There are new functions for statusbar display. Please use them where appropriate to make statusbar helpful and informative:
void sp_view_set_statusf (SPView *view, const gchar *format, ...);
Sets statusbar message permanently. The format string and the rest of arguments are as in printf(). Not to be used normally, because the message never disappears unless replaced by another message. In the majority of situations, one of the _flash or _error functions should be used instead.
void sp_view_clear_status (SPView *view);
Clears statusbar message permanently. Not to be used normally. In the majority of situations, one of the _flash or _error functions should be used instead.
void sp_view_set_statusf_flash (SPView *view, const gchar *format, ...);
Displays message temporarily for 1 second; when the message disappears, the one that was in the statusbar before it is restored. Use this function for short helpful hints or explanations of non-trivial actions. Examples: "No-break space" when you press ctrl-space in text object; "Closing path" when hitting the anchor in freehand; "Selection cancelled" when pressing Esc cancelled rubberband selection.
void sp_view_set_statusf_error (SPView *view, const gchar *format, ...);
Displays message temporarily for 5 seconds; when the message disappears, the one that was in the statusbar before it is restored. Use this function for most non-fatal error messages (unless they are so important as to warrant a modal messagebox). Examples: "To join, you must have two endnodes selected" when you try to join nodes that are not exactly two endpoints; "To subtract, you must have two objects selected" for the boolean difference operation.
The only potential difficulty with these functions is figuring out the SPView. How you do this depends on what you have at hand when you call one of these functions. Examples:
SPEventContext *ec; sp_view_set_statusf_flash (SP_VIEW(ec->desktop), format, ...);
SPSelection *sel; sp_view_set_statusf_flash (SP_VIEW(sel->desktop), format, ...);
SPNodePath *nodepath; sp_view_set_statusf_flash (SP_VIEW(nodepath->desktop), format, ...);
_________________________________________________________________ Our best dial-up offer is back. Get MSN Dial-up Internet Service for 6 months @ $9.95/month now! http://join.msn.com/?page=dept/dialup
On Mon, 2003-12-15 at 12:50, bulia byak wrote:
void sp_view_set_statusf (SPView *view, const gchar *format, ...); void sp_view_set_statusf_flash (SPView *view, const gchar *format, ...); void sp_view_set_statusf_error (SPView *view, const gchar *format, ...);
Looks good. I particularly like naming _error after its meaning, rather than specific details of its presentation -- it's a good abstraction. ^_^
-mental
participants (2)
-
bulia byak
-
MenTaLguY