Re: Z-ordering



On 03/11/11 06:36, D. R. Evans wrote:
Murray Cumming said the following at 11/02/2011 10:30 AM :
On Wed, 2011-11-02 at 09:22 -0600, D. R. Evans wrote:
Murray Cumming said the following at 11/02/2011 08:21 AM :
On Wed, 2011-11-02 at 08:10 -0600, D. R. Evans wrote:
So can anyone suggest a gtkmm-based library that does know about the
Z-order of overlapping widgets?
I think you can put widgets in a GooCanvas. GooCanvas has z ordering. I
have no idea how well that works. I don't personally think that there's
much point in widgets in a regular UI overlapping. I can see the point
of them overlapping in a very custom canvas-based UI.

Well if you don't see the point then perhaps I'm missing something. In a
system without Z ordering how would you deal with the following situation:

I have a multi-container widget and a bunch of widgets are visible. Now the
user presses a particular key combination and a previously-invisible widget
needs to appear "in front of" an area of the container.
Widgets can never be anything but "in front" of their container. You can
I understand that they are "in front of" their container, but that's not
what I'm having a problem with. It's getting some widgets to be temporarily
"in front of" other widgets in the same container.
My understanding is that Gtkmm is based on the idea of not defining widget relationships absolutely, on the basis that when you change screen resolution/ output device/ window size you want to retain the relative relationships between widgets. One option is a second window (either a Gtk::Window or a Gtk::Dialog); it will popup in front of your main window, but defining the window location is only able to be done in relative terms; it's a guide for the Window manager, not a method internal to gtkmm.

You're talking about effectively replacing widgets, though, so a second window won't achieve the effect you want. You could use hide() and show() on your primary widget and its replacement; the two widgets would need to be guaranteed to be the same size for any window shape, but with some intelligent packing it should work OK. Alternatively, if you want an absolute relationship between widgets, you need a drawing widget. If you go that way, a Gtk::Layout has the methods you want.

Ian.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]