Advertisement
joanmarie

gtk+ tree oddness

Feb 27th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. # 1. Launch gtk3-demo and this listener
  4. # 2. Down Arrow several times in the tree on the left
  5. # 3. Up Arrow several times in the tree on the left
  6. # 4. Down Arrow several times in the tree on the left
  7. #
  8. # Results: As soon as step 3 gets performed, items claim to not be selected
  9.  
  10. import pyatspi
  11.  
  12. def listener(e):
  13.     newDescendant = e.any_data
  14.     state = newDescendant.getState()
  15.     print "new descendant: %s is selected: %s" % \
  16.         (newDescendant.name, bool(state.contains(pyatspi.STATE_SELECTED)))
  17.  
  18. pyatspi.Registry.registerEventListener(listener, "object:active-descendant-changed")
  19. pyatspi.Registry.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement