[Tkinter-discuss] Interrupt a long process

Vasilis Vlachoudis Vasilis.Vlachoudis at cern.ch
Fri Feb 14 10:57:15 CET 2014


Thank you, it worked!

Vasilis


________________________________________
From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Michael Lange [klappnase at web.de]
Sent: 07 February 2014 19:37
To: tkinter-discuss at python.org
Subject: Re: [Tkinter-discuss] Interrupt a long process

Hi,

On Fri, 7 Feb 2014 16:46:58 +0000
Vasilis Vlachoudis <Vasilis.Vlachoudis at cern.ch> wrote:

> Hi all,
>
> in my canvas sometimes it happens to have a long process to insert lots
> of items.
>
> This typically takes a lot of time (up to min) so I want to give the
> possibility to the user to interrupt this process.
> And since I am adding to the Canvas I cannot push it on a thread.
>
> So in the main thread, in the big loop, once I exceed a certain time
> I display a button to interrupt the long process and I call the
> update_idletasks() periodically. However it is not possible for the
> user to click on the button.
>
> It seems that the update_idletasks doesn't update the "Button-1"
> messages How can I do it?

sounds like this is one of the rare cases where you will have to use
update() instead of update_idletasks()

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

We Klingons believe as you do -- the sick should die.  Only the strong
should live.
                -- Kras, "Friday's Child", stardate 3497.2
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss at python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


More information about the Tkinter-discuss mailing list