strongwind r15 - in trunk: . strongwind



Author: btaylor
Date: Fri Jun 13 00:18:37 2008
New Revision: 15
URL: http://svn.gnome.org/viewvc/strongwind?rev=15&view=rev

Log:
2008-06-12  Brad Taylor  <brad getcoded net>
	
	* strongwind/accessibles.py: Implement grabFocus for Dialog and Frame.



Modified:
   trunk/ChangeLog
   trunk/strongwind/accessibles.py

Modified: trunk/strongwind/accessibles.py
==============================================================================
--- trunk/strongwind/accessibles.py	(original)
+++ trunk/strongwind/accessibles.py	Fri Jun 13 00:18:37 2008
@@ -667,6 +667,16 @@
 
         assert utils.retryUntilTrue(closed)
 
+    def grabFocus(self):
+        '''
+        Frames are not focusable, so emulate the behavior by finding the first
+        focusable child of this Frame and calling grabFocus on it
+        '''
+        try:
+            utils.findDescendant(self, lambda x: x.focusable and x.showing).grabFocus()
+        except:
+            pass
+
 class Dialog(Accessible):
     def ok(self, assertClosed=True):
         'Click the OK button'
@@ -711,6 +721,16 @@
 
         assert utils.retryUntilTrue(closed)
 
+    def grabFocus(self):
+        '''
+        Dialogs are not focusable, so emulate the behavior by finding the first
+        focusable child of this Dialog and calling grabFocus on it
+        '''
+        try:
+            utils.findDescendant(self, lambda x: x.focusable and x.showing).grabFocus()
+        except:
+            pass
+
 class Alert(Accessible):
     def __init__(self, accessible):
         super(Alert, self).__init__(accessible)



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