[gjs/gnome-3-38] examples: Fix Clutter example
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gjs/gnome-3-38] examples: Fix Clutter example
- Date: Thu,  8 Oct 2020 22:29:20 +0000 (UTC)
commit 8fcde78cc2f98d5f42bbe926cad5239dc2bd37be
Author: Philip Chimento <philip chimento gmail com>
Date:   Sun Sep 6 21:09:22 2020 -0700
    examples: Fix Clutter example
    
    I noticed it was broken while testing it with a new test.jpg image.
 examples/clutter.js | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/examples/clutter.js b/examples/clutter.js
index 4a15669b..a775b60a 100644
--- a/examples/clutter.js
+++ b/examples/clutter.js
@@ -2,7 +2,7 @@ const Clutter = imports.gi.Clutter;
 
 Clutter.init(null);
 
-let stage = new Clutter.Stage();
+const stage = new Clutter.Stage({visible: true});
 
 let texture = new Clutter.Texture({
     filename: 'test.jpg',
@@ -14,12 +14,9 @@ texture.connect('button-press-event', () => {
     return Clutter.EVENT_STOP;
 });
 
-let color = new Clutter.Color();
-color.from_string('Black');
+const [, color] = Clutter.Color.from_string('Black');
+stage.background_color = color;
 
-stage.color = color;
-
-stage.add_actor(texture);
-stage.show();
+stage.add_child(texture);
 
 Clutter.main();
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]