Bugzilla – Attachment 284435 Details for
Bug 492770
ContextMenu: MenuItem Position is wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
at-spi sample.
context_menu_position.py (text/x-python), 882 bytes, created by
Neville Gao
on 2009-04-07 09:55:48 UTC
(
hide
)
Description:
at-spi sample.
Filename:
MIME Type:
Creator:
Neville Gao
Created:
2009-04-07 09:55:48 UTC
Size:
882 bytes
patch
obsolete
>#!/usr/bin/env python > >import pyatspi >import time > >reg = pyatspi.Registry >find = pyatspi.findDescendant >findAll = pyatspi.findAllDescendants > >desktop = reg.getDesktop(0) >ipy = find(desktop, lambda x: x.name == 'ipy' and x.getRoleName() == 'application') >frame = find(ipy, lambda x: x.getRoleName() == 'frame') >label = find(frame, lambda x: x.getRoleName() == 'label') > >extents = label.queryComponent().getExtents(pyatspi.DESKTOP_COORDS) >x = extents.x + (extents.width / 2) >y = extents.y + (extents.height / 2) > ># open context menu strip >reg.generateMouseEvent(x, y, pyatspi.MOUSE_B3C) >time.sleep(1) > >context_menu = find(ipy, lambda x: x.getRoleName() == 'window') >menu_item = find(context_menu, lambda x: x.name == 'Item 1') > >extents = menu_item.queryComponent().getExtents(pyatspi.DESKTOP_COORDS) >x = extents.x + (extents.width / 2) >y = extents.y + (extents.height / 2) >print x, y
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 492770
: 284435