Top | ![]() |
![]() |
![]() |
![]() |
GtkApplication * | application | Read / Write / Construct Only |
AmtkFactoryFlags | default-flags | Read / Write |
AmtkFactory is a base class to create menu or toolbar items (or anything else) from AmtkActionInfo's. A factory function accesses an AmtkActionInfo from the AmtkActionInfoCentralStore.
A GtkApplication can be associated so that factory functions can call
gtk_application_set_accels_for_action()
with the accelerators returned by
amtk_action_info_get_accels()
(this erases previously set accelerators for
that action, if any). Note that gtk_application_set_accels_for_action()
is
called by factory functions and not by amtk_action_info_store_add()
, so that
libraries can provide their own store and the accelerators are set to the
GtkApplication only if an AmtkActionInfo is actually used.
AmtkFactoryFlags permits to control how a factory function creates the
object, to ignore some steps. Factory functions should be declined in two
variants: a simple form which takes the value of the
“default-flags” property, and the same function with the _full
suffix which takes an AmtkFactoryFlags argument and ignores the
“default-flags”. See for example
amtk_factory_menu_create_menu_item()
and
amtk_factory_menu_create_menu_item_full()
.
Once the objects are created, an AmtkFactory should be freed because it has a strong reference to the GtkApplication. TODO: change it to a weak ref instead so that this paragraph can be removed.
GtkApplication *
amtk_factory_get_application (AmtkFactory *factory
);
Since: 3.0
AmtkFactoryFlags
amtk_factory_get_default_flags (AmtkFactory *factory
);
Since: 3.0
void amtk_factory_set_default_flags (AmtkFactory *factory
,AmtkFactoryFlags default_flags
);
Sets the “default-flags” property.
Since: 3.0
AmtkFactoryFlags permits to control how a factory function creates the object, to ignore some steps.
No flags. |
||
Do not call |
||
Do not set an icon. |
||
Do not set a label/short description. |
||
Do not set a tooltip/long description. |
||
Ignore completely the accelerators. |
||
Ignore the accelerators for documentation purposes only. For example do not add/configure a GtkAccelLabel. |
||
Do not call
|
Since: 3.0
“application”
property“application” GtkApplication *
The associated GtkApplication. AmtkFactory has a strong reference to the GtkApplication (which means that once the widgets are created you should free the AmtkFactory).
Flags: Read / Write / Construct Only
Since: 3.0
“default-flags”
property“default-flags” AmtkFactoryFlags
The default AmtkFactoryFlags.
Flags: Read / Write
Since: 3.0