[Tutor] cannot get a label message to display immediately

boB Stepp robertvstepp at gmail.com
Fri Aug 14 18:56:23 CEST 2015


On Fri, Aug 14, 2015 at 11:32 AM, Bill Allen <wallenpb at gmail.com> wrote:
>
> I am working in Tkinter.   The scenario is that I click a button that
> starts a function running.   No problem there.   However, the function may
> take some time to run and I do not want the user to be worried.   I am
> wanting to immediately set a label when the function starts to say "Please
> Wait".  However, the label does not show up until the function completes.
> How do I get both actions to happen essentially at the same time, the
> writing of the label and the execution of the function?  I have no code to
> show on this one because I am lost in the weeds, not sure of the general
> way to go on this.

I am on the path to learning myself, but couldn't you, as part of the
function, have it either set the label itself or call another function
that does this, and then execute the main part of your function?
Also, just before your function returns its result, it could
clear/rewrite the label.

Additionally, tkinter has the ability to change the cursor to an
hourglass.  You could handle this analogously to what I already said.

HTH,


-- 
boB


More information about the Tutor mailing list