Re: progress API




Tim Janik <timj@gtk.org> writes: 
> put this rationale into the header file please,
> preferable as a block comment, preceeding all five function definitions.
> comments, btw, in gtk code are of the following styles:
> 

I think you've had to remind me about this on every patch I've ever
submitted. ;-) 
 
> not only "Sigh." ;)
> having to call gtk_progress_bar_real_update() directly sucks majorly,
> instead, what about making GtkProgress::update a real signal, and have
> void gtk_progress_update (GtkProgress *progress);
> emitting it?

I'm wanting to deprecate GtkProgress entirely (it's a pointless node
in the object hierarchy), so this should really be a signal on
GtkProgressBar - how about calling it "refreshed"?

"refreshed" would be emitted when set_percentage() or pulse() is
called, i.e. anytime there's been some progress you're guaranteed to
get this signal emission.

The signal should be for notification only, i.e. I don't think it
makes sense to have the current update() functionality as the default
handler for "refresh", because the current update() code is
user-transparent and not well-defined; it would be broken to override
the update() function, or emit_stop() an "update" signal. Basically I
have no idea why update() is virtualized at all. If you pretend that
gtk_progress_bar_real_update() isn't in the class struct, probably you
wouldn't object to using it where I'm using it.

If "refreshed" has a default handler the signal should be "refresh"
and take arguments, like 
  (GtkProgressBar *pbar, gfloat fraction, gboolean activity_mode)

or something, and then the user could stop or modify an in-progress
refresh, but that seems like a really useless feature, I think you
only want to be notified of a refresh, rather than changing it.

If you want a default handler here, please define for me what it's
supposed to do. ;-)


BTW I have a "havoc-patches" branch in CVS now, so rather than
applying diffs for any of this stuff I've been posting, it should be
merged in from the branch.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]