[gtkmvc-users] Communicating between sub-models/sub-controllers
Brought to you by:
cavada
From: Steve M. <smc...@gm...> - 2010-07-16 04:53:36
|
Hey list, This may be a dumb question, but I can't quite find a clear answer. I am implementing a music player using the gtkmvc framework, where the parts relevant to this discussion are structured as follows. I have a set of top level classes, appController, appModel, appView. Under appController I have a collectionController, and a playlistController, which each have their own respective view and model. They represent the music collection in a database, and the current playlist. I have a signal handler in collectionController which should add a song to the current playlist. Thus, collectionController needs to call a method in either playlistController, or directly on playlistModel (a ListStoreModel). The only apparent solution I can come up with is to pass a reference to playlistModel into the constructor for collectionController, but somehow this seems messy to me. Is there a better way to do this? I will also encounter a problem with my actual playback code, which I intend to create as another sub-model of appModel. Will signals emitted from a sub-model make it to the parent model's controller without help? Thanks in advance, -Steve -- If it ain't broke, you're not using a new enough version |