Re: Find out if a widget or window is actually visible?



On Oct 26, 2006, at 3:20 AM, Toralf Lund wrote:
Does Gtkmm/Gdkmm offer a nice and simple way to find out if a widget or window is actually visible to the user, i.e. is mapped *and not obscured
by another window*? I mean, .e.g Gdk::Window::is_viewable () and
Gdk::Window::is_visible ()/Gtk::Widget::is_visible() will answer only first half of that question, I believe, i.e. they will tell me whether the window/widget is mapped, but not check if it is covered by something
else.

- Toralf


I am not sure if it about GTKmm at all. The system manages windows
that represent a space for different applications. Each application
can be written using it's own GUI framework: GTKmm, Qt, Tkinter, and
so on. Thus maybe your question should be addressed to a "guy" that is
responsible for sending a sort of "REDRAW_WINDOW" signal whenever it
is needed and a part of window becomes visible. I guess that should be some kind of System GUI Manager that is definitely different in Linux,
Windows, Mac OS X, etc. Therefor the "guy" you are looking is System.
No, I don't think so. By that argument, Gdk::Window should never be
used. Or even be there in the first place. No, wait, you can make that
all of Gdk. And add the event handling infrastructure in Gtk. 'Cause the
job is done by the back-end GUI libs or windowing system, really...
But isn't one of the prime features of Gtk actually that it allows you
to interact with windows without having to worry about system details or
platform differences? It's a cross-platform toolkit, you see...

However, this question is "different". For one, the system may provide no means of finding out. And in some systems, "visible" may not be meaningful. There's an X server I've seen that renders everything, unobscured, offscreen, and then does some quite advanced and strange compositing. The question of "visibility" is next-to- meaningless in the context of that system.

- Michael



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