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

Re: Progress bar cancellation



Colin Watson wrote:
On Mon, Jan 16, 2006 at 09:47:23PM +0100, Attilio Fiandrotti wrote:

Today i've tried to implement the cancel button for the progressbar in the GTK frontend: as GTK is an event driven toolkit (differently from the NEWT toolkit) some thinking is needed on how to manage user's input and calls from cdebconf clients.


You can't process the cancel button entirely asynchronously anyway,
since the only point at which you get to communicate the fact that the
user cancelled back to the confmodule is when a PROGRESS SET/STEP/INFO
command is given.

I was thinking to asynchronously handling the "clicked" GtkSignal via a thread that, when the signal is received, sets a flags to "TRUE". When gtk_progress_xxx() runs, before returning, the value of the flag is checked: in the case it's FALSE, then DC_OK is returned; else, if the flag was previously set to true, then the flag is resetted to FALSE and DC_GOBACK is returned.
Does this sound correct to you?

ciao

Attilio



Reply to: