Binding css-classes in .ui file

,

I want to bind the css-classes property in my .ui like so:

<binding name="css-classes">
  <lookup name="css_classes" type="Answer">
    <lookup name="quiz">QuizWindow</lookup>
  </lookup>
</binding>

What should be the type of the css_classes property?

 css_classes: GObject.ParamSpec.string(
  "css_classes",
  "css-classes",
  "CSS classes to style the labels",
  GObject.ParamFlags.READWRITE,
   ""),

I tried all the types I can think of but I keep getting the error below.

GLib-GObject-CRITICAL **: 21:28:29.199: unable to set property 'css-classes' of type 'GStrv' from value of type 'gchararray'

What is the equivalent of 'GStrv' in language binding like JavaScript?

GStrv is a boxed type, so the following should work:

css_classes: GObject.ParamSpec.boxed(
    'css-classes', null, null,
    GObject.ParamFlags.READWRITE,
    GObject.type_from_name('GStrv')),
1 Like

Thank you very much.