summaryrefslogtreecommitdiff
path: root/cad/src/experimental/demoapp_0.1/outtakes/layout-outtakes.py
blob: 8aebd290908177156ee626d42560895d8535db64 (plain)
1
2
3
4
5
6
7
8
    # or maybe store this on the children, as child.size, child.pos, or child.rect, etc?
    # since the children sometimes need to know it too (incl when drawing).
    def find_child(self, x, y):
        for child, (cx,cy,w,h) in self._layout.iteritems(): # maps children -> rects
            if (cx <= x < cx + w and
                cy <= y < cy + h):
                return child
        return None