Managing multiple figures in a GUI

3 vues (au cours des 30 derniers jours)
Eduardo Nigro
Eduardo Nigro le 24 Mai 2012
I have 2 figures in a GUI and I want to have one of them (smaller one) always on top of the other one (larger one) even when the larger one is the active figure. How can I achieve that?
Note: I don't want to have the smaller figure as a 'modal' since I am actively interacting with the larger one.
  2 commentaires
Oleg Komarov
Oleg Komarov le 24 Mai 2012
Why don't you embed what the small active figure does in the big one?
Eduardo Nigro
Eduardo Nigro le 25 Mai 2012
Good point Oleg. I am trying to avoid that for two reasons:
1) The main window is packed!
2) It's a feature that users may turn on and off. I don't want it taking up real state space in the main window. The other option such as rearranging objects in the main window when I turn the feature on will make it too busy.
Thanks anyway. I may have to go that route if I can't figure it out...

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 25 Mai 2012
Unfortunately in some window managers, only the upper-most window can receive keyboard input. On those systems, this is not under the control of the individual programs.
The two relevant controls in window managers are often known as "autoraise" and "click to type". "click to type" means that you need to click on a window in order for it to receive keyboard input, but does not in itself imply anything about the window being brought to the foreground. "autoraise" means that as soon as you interact with a window it is brought to the foreground.
For many years I worked on a Unix system configured with autoraise and "click to type" both turned off. I found that to be very productive. For example I could have a small document with some text I needed in the foreground, and have my larger active window underneath, and then I could transcribe from the one to another with both areas of interest visible. With the OS-X system I am using now, the document I am typing into must be the foreground, so I would have to keep raising my edit window to type to it, hiding the window that had the information I needed to type in. A challenge to short term memory.
Anyhow...
  2 commentaires
Walter Roberson
Walter Roberson le 25 Mai 2012
Now that I think of it, autoraise might have been to automatically raise a window if you moused over it for sufficiently long (and it wasn't very long at all.) [Yikes, the amount I have forgotten over the years...]
Eduardo Nigro
Eduardo Nigro le 29 Mai 2012
Hi Walter. Thanks for the answer. I did work with UNIX systems some 15 years ago and I do recall that feature (probably why I thought it would be straight forward to implement it in MS Windows).
As a solution for now, I am "creating" my own window using uicontrols such as frames, text boxes and buttons that will stay on top if defined at the very end of my GUI layout portion of the code.
However, minimize, restore and window drag functionalities have to be coded now, instead of being taken for granted!

Connectez-vous pour commenter.

Plus de réponses (1)

Stephen
Stephen le 24 Mai 2012
just don't make the large on active and change stuff on it using its handle and set()
  1 commentaire
Eduardo Nigro
Eduardo Nigro le 25 Mai 2012
Thanks Stephen. But the stuff I will be changing in the main window is based on mouse click and mouse motion events (in the main window) which to my knowledge automatically make it active.
Basically, if I am clicking and dragging objects in the main window, I want the smaller one to stay on top and update some of its objects in real time. That's where I am stuck.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by