testinggtk r393 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r393 - trunk/tests
- Date: Fri, 29 Aug 2008 23:06:29 +0000 (UTC)
Author: bjornl
Date: Fri Aug 29 23:06:29 2008
New Revision: 393
URL: http://svn.gnome.org/viewvc/testinggtk?rev=393&view=rev
Log:
Add two tests for the grab_focus method
Modified:
trunk/tests/test_widget.py
Modified: trunk/tests/test_widget.py
==============================================================================
--- trunk/tests/test_widget.py (original)
+++ trunk/tests/test_widget.py Fri Aug 29 23:06:29 2008
@@ -235,3 +235,26 @@
assert not gtk.grab_get_current()
widget.grab_remove()
+def test_grab_focus():
+ '''
+ Ensure that calling ``grab_focus`` on a widget makes that widget
+ the focus widget within its toplevel.
+ '''
+ widget = gtk.Button()
+ win = gtk.Window()
+ win.add(widget)
+ widget.grab_focus()
+ assert widget.is_focus()
+
+def test_grab_focus_unfocusable():
+ '''
+ Ensure that calling ``grab_focus`` on an unfocusable widget does
+ not have any effect.
+ '''
+ widget = gtk.Button()
+ widget.set_property('can-focus', False)
+ win = gtk.Window()
+ win.add(widget)
+ widget.grab_focus()
+ assert not widget.is_focus()
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]