Extension headerbar example does not work
Not sure if this is a documentation issue or a gjs issue, but the example for modifying the prefs window headerbar doesn't work:
GLib.timeout_add(0, () => {
let window = prefsWidget.get_toplevel();
let headerBar = window.get_titlebar();
headerbar.title = `${Me.metadata.name} Preferences`;
return GLib.SOURCE_REMOVE;
});
-
GLib.timeout_add
takes a user_data argument, so I addednull
to thetimeout_add
call. -
GtkWidget.get_toplevel
doesn't exist, so I replaced it withget_root()
. - Finally, the code will run, but errors out in the
timeout_add
call with
Error: Argument interval: value is out of range for uint32
Which seems to be a gjs issue with marshalling the interval parameter, but that would be a pretty fundamental issue.