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



On Monday 30 October 2006 08:10, Toralf Lund wrote:
> Chris Vine wrote:
> > On Wednesday 25 October 2006 10:21, 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.
> >
> > I am not entirely sure if I understand you but Gtk::Widget::is_visible()
> > will tell you whether the widget is obscured.  (Note however that a
> > minimised window still counts as visible so in practice you will need to
> > check for both.)
>
> I thought I proved by testing that is_visible() would merely check
> whether show() had been called - not if the widget or window was
> actually visible to the user, but maybe I got it wrong...

The signal responds to things done on the desktop rather than by you.  You 
(the programmer) can keep your own flags about what you have done 
programmatically.  For that reason if hide() is called the signal is not 
emitted (but Gtk::Widget::is_visible() will correctly state that it is not 
visible).  I do not really understand what you mean about show().  If you 
have called hide() and it remains hidden (that is, you have not called 
Gtk::Window::present() in the case of a window or Gtk::Widget::show() in the 
case of a widget) then Gtk::Window::is_visible() will return the correct 
result, at least when I use it.

Chris




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