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

How do you split all of a certain character in Python [duplicate]
Issues with data types in pandas functions
Firebase Console but there is error tell “Error Generating Download URL”
Python Twitter Streaming Timeline
Interval intersection in pandas
Putting double quotes for an output string
How to query with raw SQL using Session or engine
getUser return EDAMSystemException errorCode=8
How to print the subject of a single email using uid
Avoiding Python globals in Google App/Cloud Engine
Python Google Voice get texts from [number]
Create a dictionary from values of a function, and using that for a graph
Attributes just disappear when I give a method as parameter
Send entries for FieldList of StringField from postman to flask
Canonical Discriminant Function in Python sklearn
Python requests ConnectionError

Categories

HOME
dotnetrdf
crystal-reports
erlang
amazon-swf
nuxeo
bower
fparsec
cpu-architecture
memory-leaks
laravel-5.2
schemacrawler
shader
deeplearning4j
height
vuex
lenskit
lstm
uisplitviewcontroller
bootstrap-popover
zoomcharts
thumbnails
distance
restfb
jflex
jboss5.x
spring-profiles
division
viewstate
passenger
jboss-esb
sonarqube-scan
magiczoomplus
ntfs-mft
viewgroup
tripwire
react-native-router-flux
constants
service-fabric-stateful
rkt
facebook-chatbot
dojox.grid.datagrid
number-theory
livefyre
seamless-immutable
mouseclick-event
spring-data-hadoop
text-classification
ticker
httplib2
castle-dynamicproxy
unity3d-editor
hspec
zurb-foundation-apps
jackson-databind
soda
asynccallback
cmocka
galaxy
void
windows-vista
sysfs
android-search
c++-actor-framework
microblaze
fragment-tab-host
cg
docopt
suffix-array
dache
picat
help-viewer
initialization-vector
astyanax
dllexport
justgage
iconv
client-library
graph-coloring
qt4.6
icsharpcode
enumerators
web-safe-fonts
n-layer
cosm
unions
windows-phone-7-emulator
hobo
paintcomponent
smooth
recordset
revert
clients

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