Which event is generated when a widget is shown



Hello list,
I am trying to make a simple screenshot taking script with Dogtail.
I found an example how to use at-spi events which I modified.
The attached file takes screenshots when a window:activate event is detected. However the images don't look nice. The screenshot is taken while the window is repainting itself, everything appears gray.

Which event is generated when the window/widget is shown?
How can I take the screenshot after everything has been shown on the screen?


Thanks,
Alexander.
#!/usr/bin/env python

import atspi
from dogtail.tree import Node
from dogtail.utils import screenshot

# Test of event callbacks
# Under construction

def callback(event):
    source = event.source
    if isinstance(source, atspi.Accessible):
        sourceStr = ", source:%s"%(str(Node(source)))
    else:
        sourceStr = ""
    print "%s%s"%(event.type, sourceStr)
    
    screenshot()

# explicit list of all events, taken from at-spi/test/event-listener-test.c:
eventNames = [
#    "window:minimize",
#    "window:maximize",
#    "window:restore",
    "window:activate"
#    "window:create",
#    "window:deactivate",
#    "window:close",
#    "window:lower",
#    "window:raise",
#    "window:resize",
#    "window:shade",
#    "window:unshade"
#    "window:show"
    ]

listener = atspi.EventListener(callback, eventNames)
atspi.event_main()


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