Re: How do i find out if a widget is shown or hidden?



On Mon, 10 May 2010 12:22:58 +0200
Lothar Scholz <llothar web de> wrote:
> CV> On Mon, 10 May 2010 04:31:59 +0200
> CV> Lothar Scholz <llothar web de> wrote:
> >> There seems to be no "gtk_widget_is_shown" or
> >> "gtk_widget_is_hidden" function. How do i find out if it is
> >> already shown?
> CV>  
> CV> That depends on what you mean.  You can find out if it has been
> CV> shown or hidden programmatically by calling GTK_WIDGET_VISIBLE()
> CV> (or from gtk+-2.18, gtk_widget_get_visible()). However, that will
> CV> not tell you whether the widget is obscured or iconified (that
> CV> is, whether it is actually visible on the desktop). You will need
> CV> to track notify events and state events to do that.
> 
> Thanks, i thought on X11 it just means this "visible".
> 
> So if it is fully covered by other windows or moved out of the range
> of the root window.
> 
> I will check it.

One interesting thing you will find when you do that is that
calling hide on the window will cause GTK_WIDGET_VISIBLE() to return
false but will NOT trigger a window visibility event.  And it will
absolutely not tell you whether the window is obscured or not.

Chris


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