473,508 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[GUI Design] How to achieve short comm paths between controls?

+--------------------------------------------------------------+
| |
+--------------------------------------------------------------+
| +--------+ |
| | Page 1 | |
|-+ +---------------------------------------------------|
| | +- Group ------------------------+|
| # | ||
| lhs pane | | || rhs pane
| | | ||
| | | ||
| +----------------------+ | | ||
| |A control, | | | Editor object ||
| |which properties | | | ||
| |have to be edited | | | ||
| |with the editor in the| | | ||
| |rhs pane | | | ||
| +----------------------+ | | ||
| | +--------------------------------+|
+--------------------------------------------------------------+

When I click on the control within the lhs pane, I want to display the
appropriate editor, which displays the control's properties. To do so I need
the group box in the rhs pane as the editor's parent. Therefore the text
control tells the MainFrame (module variable as a singleton) to display the
right editor. So this path is short.

But now, down the path, I get into troubles: The MainFrame does not know
about the group box in the rhs pane of the active page of the notebook
within the MainFrame. See?

So the path is: MainFrame ---displayEditor()-->
NoteBook ---displayEditor()--> Currently selected page. The nesting down
stops here, because the page knows about the group box within the pane,
because it created them.

I'm in doubt that this is a design pattern issue. I guess it's about
organizing all the controls of a GUI.

Should I create a dict with control name/object pairs, held by the
MainFrame?

Or should the rhs group box a globally accessible singleton or Borg?

Any other hint? How do you handle such situations?

I sketched the app both with wxPython and PMW/Tkinter. Is this what PyQt's
slots are for? Can I connect the lhs control with the rhs group box? It'S
hard for me to see how this would solve the problem, because the distance
between the controls remains. Well, I guess the dict mentioned above is not
the worst here, is it?

Any hint welcome.

Regards
Franz GEIGER

Jul 18 '05 #1
1 1562
On Wed, 2003-08-27 at 12:29, F. GEIGER wrote:

[snip nice diagram]
Should I create a dict with control name/object pairs, held by the
MainFrame?
This doesn't sound too bad.
Or should the rhs group box a globally accessible singleton or Borg?
Trying to get past my prejudice against the word global to see this
solution objectively and just can't.
Any other hint? How do you handle such situations?


Perhaps by generating a custom event and posting it to the main window?
If you're using wxPython, you might take a look at the dispatcher
module. I haven't used it yet, but it might be appropriate to this sort
of task. Regardless, I'd certainly post to the wxPython user list to
see what people there come up with.

Regards,
Cliff

--
She clings to the nearest passerby, she's lost control again
-Joy Division
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
2241
by: rzed | last post by:
Periodically, we see questions about which gui package is best, or which database package to use. These questions typically trigger some exchanges of opinion, though of course this no one best...
1
3261
by: MM | last post by:
Hi, First off, I'm just beginning .NET and GUI stuff and am very inexperienced. I have worked through a number of GUI tuts in books but all the GUI code to handle events for all the controls in...
5
1867
by: Macca | last post by:
Hi, I am developing an app which i want to have same style of GUI as the .NET Configuarion tool. i.e menus at top,rest of dialog dialog split into two with a tree like structure on the left and...
17
2674
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.