[pyclutter] examples: Initialize Clutter explicitly
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pyclutter] examples: Initialize Clutter explicitly
- Date: Thu, 30 Apr 2015 12:55:24 +0000 (UTC)
commit 45339634e321acfa91620efb1dde8cd9a8e8d8b9
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Apr 30 13:53:35 2015 +0100
examples: Initialize Clutter explicitly
We removed init-on-import, so we need to initialize Clutter explicitly
before using it.
examples/basic-actor.py | 2 ++
examples/canvas.py | 2 ++
examples/constraints.py | 2 ++
examples/image-content.py | 2 ++
examples/layout-manager.py | 2 ++
examples/scroll-actor.py | 2 ++
6 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/examples/basic-actor.py b/examples/basic-actor.py
index 0caca93..5c9475f 100644
--- a/examples/basic-actor.py
+++ b/examples/basic-actor.py
@@ -53,6 +53,8 @@ def on_crossing(actor, event):
return True
if __name__ == '__main__':
+ Clutter.init(None)
+
stage = Clutter.Stage(title="Three Flowers in a Vase")
stage.props.user_resizable = True
stage.connect('destroy', Clutter.main_quit)
diff --git a/examples/canvas.py b/examples/canvas.py
index d2e11b8..978000d 100644
--- a/examples/canvas.py
+++ b/examples/canvas.py
@@ -78,6 +78,8 @@ def on_actor_resize(actor, allocation, flags):
resize_id = GLib.timeout_add(500, idle_resize, actor)
if __name__ == '__main__':
+ Clutter.init(None)
+
# Our stage
stage = Clutter.Stage(title='2D Clock', user_resizable=True)
stage.props.background_color = Clutter.Color.get_static(Clutter.StaticColor.SKY_BLUE_LIGHT)
diff --git a/examples/constraints.py b/examples/constraints.py
index 404feb1..7225bfb 100644
--- a/examples/constraints.py
+++ b/examples/constraints.py
@@ -1,6 +1,8 @@
from gi.repository import Clutter
if __name__ == '__main__':
+ Clutter.init(None)
+
# The main stage
stage = Clutter.Stage(title='Constraints', user_resizable=True)
stage.props.background_color = Clutter.Color.get_static(Clutter.StaticColor.ALUMINIUM_1)
diff --git a/examples/image-content.py b/examples/image-content.py
index f6ca829..da42654 100644
--- a/examples/image-content.py
+++ b/examples/image-content.py
@@ -44,6 +44,8 @@ def on_tap(action, actor, text):
current_gravity = 0
if __name__ == '__main__':
+ Clutter.init(None)
+
# Our stage
stage = Clutter.Stage(title='Content Box', user_resizable=True)
stage.set_margin(Clutter.Margin(12))
diff --git a/examples/layout-manager.py b/examples/layout-manager.py
index 79562f6..58df0e1 100644
--- a/examples/layout-manager.py
+++ b/examples/layout-manager.py
@@ -184,6 +184,8 @@ def on_key_press(stage, event, layout):
return False
if __name__ == '__main__':
+ Clutter.init(None)
+
stage = Clutter.Stage()
stage.props.title = 'Multi-layout'
stage.connect('destroy', Clutter.main_quit)
diff --git a/examples/scroll-actor.py b/examples/scroll-actor.py
index 2ea799d..9a02a3b 100644
--- a/examples/scroll-actor.py
+++ b/examples/scroll-actor.py
@@ -113,6 +113,8 @@ def on_key_press(stage, event):
return False
if __name__ == '__main__':
+ Clutter.init(None)
+
stage = Clutter.Stage(title='Scroll Actor', user_resizable=True)
stage.connect('destroy', Clutter.main_quit)
stage.connect('key-press-event', on_key_press)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]