environment: Monkey-patch iterate_children() generator
This is a small convenience method for using ClutterActor's iterator API with javascript's built-in iterator protocol, for example as: for (let child of container.iterate_children()) doStuff(child); https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1268
This commit is contained in:
parent
82fd68b985
commit
8d4e650a95
@ -285,6 +285,11 @@ function init() {
|
||||
_easeActorProperty(this, 'value', target, params);
|
||||
};
|
||||
|
||||
Clutter.Actor.prototype.iterate_children = function* () {
|
||||
for (let c = this.get_first_child(); c; c = c.get_next_sibling())
|
||||
yield c;
|
||||
};
|
||||
|
||||
Clutter.Actor.prototype.toString = function () {
|
||||
return St.describe_actor(this);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user