Commit afeaaa12 authored by Simon Schampijer's avatar Simon Schampijer Committed by Tomeu Vizoso

Gdk.Window: Map the standard constructor to the *new* constructor

Gdk.Window had to be made abstract
(see c4a36d875235e0bf1e52dbf2fa14d08bfc8bd4ec in gtk),
this override allows using the standard constructor

This commit adds as well a testcase.
parent 858669f9
......@@ -71,6 +71,12 @@ if Gdk._version == '2.0':
class Window(Gdk.Window):
def __new__(cls, parent, attributes, attributes_mask):
# Gdk.Window had to be made abstract,
# this override allows using the standard constructor
return, attributes, attributes_mask)
def __init__(self, parent, attributes, attributes_mask):
def cairo_create(self):
return Gdk.cairo_create(self)
......@@ -330,6 +330,14 @@ class TestPango(unittest.TestCase):
class TestGdk(unittest.TestCase):
def test_constructor(self):
attribute = Gdk.WindowAttr()
attribute.window_type = Gdk.WindowType.CHILD
attributes_mask = Gdk.WindowAttributesType.X | \
window = Gdk.Window(None, attribute, attributes_mask)
self.assertEquals(window.get_window_type(), Gdk.WindowType.CHILD)
def test_color(self):
color = Gdk.Color(100, 200, 300)
self.assertEquals(, 100)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment