prevent callback during initialization

W

William Gill

I am creating several tkinter widgets. In my classes they each have a
change() method that is a callback to various IntVar, and StringVar
objects. Everything works fine, but don't really want to trigger the
callback when I am initializing each widget/control variable. I can
use a "flag" like self.initialized= true, and wrap the change() procedures
in an "if self.initialized:" block. I get the impression using "flags" is
not the preferred approach. Is there some other way to accomplish
this without using a flag?

Can I redefine my change() method in __init__(), or would that mess up
the callback references already established?

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top