GUI structure

Hi

I'm having some problems structuring my application. Method calls are going
all around from one place to the other... Are there any documentation or
tutorials on this?

In my application I have a frame with a canvas and a panel. The canvas has a
lot of different OGL shapes placed on it. The panel shows information about
the currently selected OGL shape. When the user clicks on another shape the
information changes in the panel (If it's a different shape the whole layout
changes). In other words, the OGL shapes needs to talk too the panel and the
panel needs to talk to the shapes.

How do I structure an application like this in a good way whitout getting
confused about who's dealinig with who?

For instance: Is it better to always go through the frame object, or is it
ok to interact directly between the shapes and the panel?

Hope you understood my problem.
Cheers,
Thomas

Thomas Aanensen wrote:

Hi

I'm having some problems structuring my application. Method calls are going
all around from one place to the other... Are there any documentation or
tutorials on this?

In my application I have a frame with a canvas and a panel. The canvas has a
lot of different OGL shapes placed on it. The panel shows information about
the currently selected OGL shape. When the user clicks on another shape the
information changes in the panel (If it's a different shape the whole layout
changes). In other words, the OGL shapes needs to talk too the panel and the
panel needs to talk to the shapes.

How do I structure an application like this in a good way whitout getting
confused about who's dealinig with who?

For instance: Is it better to always go through the frame object, or is it
ok to interact directly between the shapes and the panel?

There's no technical problem with it, but it may still not be as clean as is sounds like you would like it to be.

There are a number of ways to separate the GUI objects from Application functionality. There is a module in the lib that may help you implement one of them, the Puplish/Subscribe pattern. See wxPython/lib/pubsub.py, there is also wxPython/py/dispatcher.py that gives a little different spin on the same idea.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

You could have a look at the Smalltalk dependency mechanism. They used it
to uncouple the (M)odel from the (V)iew and the (C)ontroller (MVC). You
just have to decide whats M and whats VC.

Torsten

···

On Tue, 11 Nov 2003, Thomas Aanensen wrote:

Hi

I'm having some problems structuring my application. Method calls are going
all around from one place to the other... Are there any documentation or
tutorials on this?

In my application I have a frame with a canvas and a panel. The canvas has a
lot of different OGL shapes placed on it. The panel shows information about
the currently selected OGL shape. When the user clicks on another shape the
information changes in the panel (If it's a different shape the whole layout
changes). In other words, the OGL shapes needs to talk too the panel and the
panel needs to talk to the shapes.

How do I structure an application like this in a good way whitout getting
confused about who's dealinig with who?

For instance: Is it better to always go through the frame object, or is it
ok to interact directly between the shapes and the panel?

Hope you understood my problem.
Cheers,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org