Exemplo n.º 1
0
def discover_buttons(grid=30):
    '''
    try to get buttons by tab order
    '''
    tab_ls = tab_rectangles()

    if not len(tab_ls):
        log.debug('no tab order on window -> full hover test')
        # slow, no tab order
        return hover.active_rectangles(grid=grid)

    img_orig = focus_wnd()

    ls = []
    for x in tab_ls:
        bbox = hover.is_point_active(img_orig, x.center)
        if bbox:
            ls += [x]

    img_log_rects(img_orig, ls, 'img_orig')
    log.debug('buttons found:%s', ls)
    return ls
Exemplo n.º 2
0
 def test_gmessage(self):
     self.p = EasyProcess('gmessage -buttons x,y,z hi').start()
     self.wait()
     ls = tab_rectangles()
     self.assertEquals(len(ls), 4)
Exemplo n.º 3
0
 def test_notab(self):
     self.p = EasyProcess('xmessage hi').start()
     self.wait()
     ls = tab_rectangles()
     self.assertEquals(len(ls), 0)