testinggtk r364 - trunk/tests



Author: bjornl
Date: Mon Aug  4 21:50:19 2008
New Revision: 364
URL: http://svn.gnome.org/viewvc/testinggtk?rev=364&view=rev

Log:
Test for setting the keyboard focus in a window to a non-focusable widget

Modified:
   trunk/tests/test_window.py

Modified: trunk/tests/test_window.py
==============================================================================
--- trunk/tests/test_window.py	(original)
+++ trunk/tests/test_window.py	Mon Aug  4 21:50:19 2008
@@ -259,3 +259,17 @@
     win.add(hbox)
     win.show_all()
     assert win.get_focus() == v2
+
+def test_keyboard_focus_of_unfocusable_widget():
+    '''
+    Ensure that an unfocusable widget cannot have the keyboard focus
+    of a window.
+    '''
+    widget = gtk.Button()
+    widget.set_property('can-focus', False)
+    win = gtk.Window()
+    win.add(widget)
+    win.show_all()
+    assert not win.get_focus()
+    widget.grab_focus()
+    assert not win.get_focus()



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