You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mx classes seem to be not registered after import. When ClutterScript tries to load a JSON file with an Mx object, it prints an error message and the object is missing from the object list. However when any (even empty) MxStyle is loaded before, ClutterScript recognizes Mx classes correcly.
GJS script showing the problem:
#!/usr/bin/env gjs
/*
* Load a MxButton from JSON.
*/
const Clutter = imports.gi.Clutter;
const Mx = imports.gi.Mx;
CSS_DATA = "MxButton {}\n";
JSON_DATA =
'[{"type": "ClutterStage", "id": "stage", "children": [{ "type": "MxButton", "label": "click me", "id": "panic"}]}]';
Clutter.init(null);
// Uncomment this to load JSON correctly
//Mx.Style.get_default().load_from_data("dummy.css", CSS_DATA);
let script = new Clutter.Script();
script.load_from_data(JSON_DATA, JSON_DATA.length)
objects = script.list_objects()
for (var i = 0; i < objects.length; ++i) {
print(objects[i]);
}
//Uncomment this to show the loaded stage
/*
let stage = script.get_object("stage");
stage.connect("destroy", Clutter.main_quit);
stage.show();
Clutter.main();
*/
The text was updated successfully, but these errors were encountered:
Mx classes seem to be not registered after import. When ClutterScript tries to load a JSON file with an Mx object, it prints an error message and the object is missing from the object list. However when any (even empty) MxStyle is loaded before, ClutterScript recognizes Mx classes correcly.
GJS script showing the problem:
The text was updated successfully, but these errors were encountered: