[gjs: 3/18] examples: Fix Clutter example




commit 2466935b5a4539238f6e0d5267bcd0349380e462
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]