testinggtk r321 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r321 - trunk/tests
- Date: Sun, 29 Jun 2008 23:16:53 +0000 (UTC)
Author: bjornl
Date: Sun Jun 29 23:16:53 2008
New Revision: 321
URL: http://svn.gnome.org/viewvc/testinggtk?rev=321&view=rev
Log:
Test grab-notify signal
Modified:
trunk/tests/test_window.py
Modified: trunk/tests/test_window.py
==============================================================================
--- trunk/tests/test_window.py (original)
+++ trunk/tests/test_window.py Sun Jun 29 23:16:53 2008
@@ -80,3 +80,24 @@
assert len(gtk.window_list_toplevels()) == 3
for topwin, win in zip(gtk.window_list_toplevels(), windows):
assert topwin == win
+
+def test_grab_notify_emitted_when_shadowed():
+ '''
+ Ensure that ``grab-notify`` is emitted on a widget when
+ ``grab_add`` is called on a widget that is not the ancestor of
+ that widget.
+ '''
+ data = []
+ def grab_notify_cb(widget, was_grabbed):
+ data.append((widget, was_grabbed))
+
+ # Two windows
+ win = gtk.Window()
+ win2 = gtk.Window()
+ win.connect('grab-notify', grab_notify_cb)
+
+ # Grab win2, win is now "shadowed" and grab-notify should be
+ # emitted on it.
+ win2.grab_add()
+
+ assert data[0] == (win, False)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]