Re: Model View Controller. How to implement?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Pressing play button in my controller starts new process that simulates
>some process. (BTW. Should I create a new process? In other way, program
>will return from callback function when my process finishes. I think
>this is bad, when process takes a very long time. Also I want to stop,
>pause process.) 

you are already using threads, so this is enough. the problem,
i think, is that GObject signals are not inherently cross-thread
constructs. Emitting a signal from your computation thread and hoping
that the view will update itself correctly will only work if you are
doing the appropriate locking/unlocking using gdk_threads_enter() and
gdk_threads_leave(). Otherwise you have two threads potentially trying
to do GUI operations at the same time, leading to many problems.

>The problem here is that although "changed" signal recieved, it's not
>procesed by view, as computation function in other thread, continue it's
>work, and so do not allow to update views and sends another signal.

i don't entirely understand this sentence.

--p
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux