Hi everyone,

I have an Entry widget inside an EventBox (innerEventBox), and I have the 
innerEventBox inside another
EventBox (outerEventBox).

I need to traverse from the Entry widget to the outerEventBox so I can set the 
background color of the
outerEventBox.

I have the following code to do this:

         get2ndAncestor :: Widget -> GType -> IO (Maybe Widget)
         get2ndAncestor widget gtype =
            do ancestor1 <- widgetGetAncestor widget gtype
               ancestor2 <- maybe (return Nothing) ((flip widgetGetAncestor) 
gtype) ancestor1
               return ancestor2

When I use this code, it gets the 1st ancestor correctly, but the 2nd ancestor 
is the same as the 1st.
The code above never returns the 2nd ancestor.

The docs for widgetGetAncestor has a line that says:

"Note that unlike widgetIsAncestor, widgetGetAncestor considers widget to be an 
ancestor of itself."

I am not sure exactly what that line means, and if it is the cause of my 
problems.  If so, how do I get the
ancestor of the ancestor of a widget?

Regards

Rouan
------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to