[linux-audio-dev] Re: MVC

Paul Davis paul at linuxaudiosystems.com
Sat May 10 08:48:00 UTC 2003

>On Fri, May 09, 2003 at 11:46:33PM +0200, Matthias Kretz wrote:
>Content-Description: signed data
>> When I was listening to your talk and about the MVC part I was pretty 
>> surprised since it was one of the first things I learned when reading about 
>> Qt/KDE programming. I was under the impression, that everyone would be using
>> it...
>Yup, its like page 2 of design patters or something.

here's a question to ask of a toolkit: can i set the depressed/raised
state of a button programmatically, without implying that the user
clicked it?

if the answer is yes, then chances are you are using a toolkit in
which MVC will be fairly easy to implement. if no, then chances are
its going to be a pain.

then ask the same question of value indicator widgets. etc.

yes, its a widely known moniker, but its not a widely used practice. i
know that in GTK+, you have to basically be willing to tolerate
feedback loops between the model and the view, so that when one is
changed, the other gets changed, which might change the first one
again, etc. heaven help you if you suffer from rounding issues between
the model and the view, because then you have no way to stop the loop
without a deadful kludge. without rounding issues, you have to do lots
of this sort of thing:

   handler_for_some_gui_event (...) {
       if (state_of_view != state_of_model) {
              change_view ();

i've rarely seen code that looks like this when i look at open source
software. maybe i'm looking for the wrong thing.


More information about the Linux-audio-dev mailing list