testinggtk r340 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r340 - trunk/tests
- Date: Thu, 17 Jul 2008 23:52:52 +0000 (UTC)
Author: bjornl
Date: Thu Jul 17 23:52:52 2008
New Revision: 340
URL: http://svn.gnome.org/viewvc/testinggtk?rev=340&view=rev
Log:
A few tests for the windows focus widget
Modified:
trunk/tests/test_window.py
Modified: trunk/tests/test_window.py
==============================================================================
--- trunk/tests/test_window.py (original)
+++ trunk/tests/test_window.py Thu Jul 17 23:52:52 2008
@@ -188,3 +188,53 @@
win.show()
win.set_gravity(gdk.GRAVITY_CENTER)
assert not win.window.get_update_area()
+
+def test_focus_widget_with_buttons():
+ '''
+ In a realized window containing three buttons, the first button
+ added is the focus widget.
+ '''
+ buttons = [gtk.Button('b') for x in range(3)]
+
+ hbox = gtk.HBox()
+ for button in buttons:
+ hbox.add(button)
+
+ win = gtk.Window()
+ win.add(hbox)
+ win.show_all()
+ assert win.get_focus() == buttons[0]
+
+def test_focus_widget_with_treeviews():
+ '''
+ In a realized window containing three treeviews, the first
+ treeview added is the focus widget.
+ '''
+ views = [gtk.TreeView() for x in range(3)]
+
+ hbox = gtk.HBox()
+ for view in views:
+ hbox.add(view)
+
+ win = gtk.Window()
+ win.add(hbox)
+ win.show_all()
+ assert win.get_focus() == views[0]
+
+def test_focus_widget_with_disabled_button():
+ '''
+ Two buttons are added two a window. The first button cannot be
+ focused so the second button should be the focus widget.
+ '''
+ b1 = gtk.Button('b1')
+ b1.set_property('can-focus', False)
+ b2 = gtk.Button('b2')
+
+ hbox = gtk.HBox()
+ hbox.add(b1)
+ hbox.add(b2)
+
+ win = gtk.Window()
+ win.add(hbox)
+ win.show_all()
+ assert win.get_focus() == b2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]