mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
docs: Document the new typeof() operator
This commit is contained in:
parent
46a06bb7b6
commit
d8f1b41ef0
1 changed files with 20 additions and 0 deletions
|
@ -161,6 +161,26 @@ Defining object properties inline
|
||||||
Note the semicolon after the closing brace of the ``Gtk.Adjustment``. It is
|
Note the semicolon after the closing brace of the ``Gtk.Adjustment``. It is
|
||||||
required.
|
required.
|
||||||
|
|
||||||
|
Type Literals
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Some properties have the type `GObject.Type <https://docs.gtk.org/gobject/alias.Type.html>`_, that is, their value is
|
||||||
|
itself a description of a type in the GObject type system. An example is
|
||||||
|
`Gio.ListStore:item-type <https://docs.gtk.org/gio/property.ListStore.item-type.html>`_. Such properties can be
|
||||||
|
specified with the ``typeof()`` operator:
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
Gio.ListStore {
|
||||||
|
item-type: typeof(.MyDataModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Though it looks like a function, ``typeof()`` is actually a special operator. This is an important syntactic
|
||||||
|
distinction because the argument to ``typeof()`` is interpreted at the grammar level as a type, not a value or
|
||||||
|
expression.
|
||||||
|
|
||||||
Bindings
|
Bindings
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue