python


tkinter Model-View-Controller: deeply-nested widgets calling the controller


I'm refactoring a tkinter GUI along a MVC design pattern. The Controller module imports a View class, and the View class makes requests to the Controller. I have a few ways of registering a change to an entry widget (StringVar trace, binding, etc.), but what if the widget is deeply nested and the callback is at a much higher level? What is the best way to have a request propagate upwards? For example, what if the View has a Frame that has a Frame that has a Widget that changes status?
The two solutions that occur to me are:
Russian Doll approach: Every inner layer is instantiated with either a reference to the View or the Controller, so the widget can directly make a request (e.g. to ViewReference.call_controller(input), or ControllerAlias.request(input). This leaves a trail of breadcrumbs from View to widget.
Family Tree approach: recursively call the parents and ask if they have an "ask controller to do thing" method. If not, ask their parents. This seems more fragile and awkward.

Related Links

Google's verify_id_token function not working
ImportError: libgomp.so.1: cannot open shared object file: No such file or directory
Django Iterating through an object set with unique_together and no pk
Can i deploy a Django project using Apache that is not located in /var/www?
How to run a python script on images present in firebase?
dictionary variable formatting in Python's Mysqldb
How to see print output from generator before ending the cycle?
Python script- need help understanding this while loop [closed]
Reset weights of a pretrained incetion_v3 model in Tensorflow
Trying to connect to FTP site but getting wrong SSL version number error?
Bokeh plot conditional background color
module installation - Mock
Best Way to create a bounding box for object detection
Read csv from Amazon s3 using python2.7
Could someone explain this Python import error? Anaconda 3.5
Python Tor server. stem/flask not showing images in tor

Categories

HOME
numpy
pug
vhdl
freepascal
windows-store-apps
jrebel
websphere-liberty
gimp
window
xamarin-studio
ndis
ssr
dryioc
game-physics
ida
ejs
scala-native
arraylist
grub2
pycrypto
avplayeritem
npm-install
skmaps
lync-2013
mef2
vcard
cgal
reply
thinking-sphinx
bitcoin-testnet
autofill
red-black-tree
jackson-dataformat-csv
read-write
construct-2
hawtio
ocs
ios-ui-automation
phpspreadsheet
bing-maps-api
.net-assembly
socketpair
poco-libraries
delphi-10.1-berlin
sendgrid-templates
ssh.net
pdftk
catia
fastq
lirc
w3-total-cache
taskmanager
chunked-encoding
seamless-immutable
multi-agent
greenhills
windows-95
gce
mercury
vici
createobject
debugdiag
aescryptoserviceprovider
visible
listadapter
scriptlet
mpeg-4
spinlock
fill
android-recyclerview
anythingslider
sonarqube5.3
insertion-sort
jta
kendo-menu
uialertview
subresource-integrity
rx-groovy
musl
ticket-system
client-side-validation
cocoascript
scala-2.11
ember-components
dto
outline
facebook-wall
dache
yahoo-boss-api
alpha-transparency
neoload
delphi-xe3
ksoap2
flash-cc
facebook-chat
sim900
bignum
bigint
multiple-conditions
device-emulation
hibernate3
userid
jquery-selectbox
hinstance
mysql-error-1045
paintcomponent
rubycas
pureftpd
j-interop
external-assemblies
linfu
integer-promotion
visual-studio-dbpro
associativity

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App