Re: Model View Controller. How to implement?
- From: Paul Davis <paul linuxaudiosystems com>
- To: Peter <volkov_peter list ru>
- Cc: gtk-list gnome org
- Subject: Re: Model View Controller. How to implement?
- Date: Thu, 10 Mar 2005 09:10:12 -0500
>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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]