Hi all,
I would have a question regarding the pubsub mechanism and if it the only way I should use in the following specific case.
I have an application where the user can select different kind of analysis from a menu. When an analysis is selected this pops up
a frame with:
-
the analysis-specific widgets necessary for setting up the analysis. They will differ from one analysis to another.
-
an additional set of buttons to cancel/save/run the analysis. They are common to all analysis.
In that context, I would like to implement the frame hosting the analysis as a kind of container/factory that just implements the common actions (cancel/run/save)
and a generic analysis widgets builder. I think that for a proper design NO analysis-specific implementations should be in the frame.
Here comes my problem.
The change in the value of one analysis widget should trigger the update of the other ones. My first idea was to use custom events in order that when
one widget is changed it sends an event captured by the other widgets sensitive to it. But I failed to find a way for widget A to post an event DIRECTLY
received and processed by widget B without passing by the frame. I do not want to pass by the frame because that would mean adding some bindings in the frame
hence losing its generic aspect.
The only way I found to solve that problem is to use the pubsub mechanism. You will find enclosed a little script that does the job.
Can I (should I ?) avoid the
use of pubsub mechanism to perform such task ? Does my aformentionned design look strange/bad to you ?
thanks a lot
Eric
test.py (1.66 KB)