pass an event up to parent widget

W

William Gill

I have a Tkinter (frame) widget that contains several other frame
widgets, each containing entry widgets. In the parent frame I have a
'save' button that is initially disabled. As it is now, each widget has
a hasChanged property that I can poll to see if updates to the source
data need to be made. hasChanged is set to True by an event routine in
each frame widget, and this works fine for my exit routine which knows
to poll each widget for hasChanged. What I don't know how to do is send
an event up the chain to the top so it can change the 'save' button to
NORMAL (telling the user 'The data has been changed and can be saved if
wanted') . I don’t think bind_class() to all entry widgets is the way
to go. I could create an after() alarm callback to poll hasChanged, but
again this seems to awkward. I have looked at widget.event_add() but,
don't know if this is viable. I am thinking a virtual event without any
SEQUENCE, and then triggering it programmatically (from within the
sub-widget event handlers). Is that doable? Isn't there a better way?


Any suggestions?


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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top