pub trait ContainerExt: 'static {
// Required methods
fn child_get_property<P: IsA<Actor>>(
&self,
child: &P,
property: &str,
value: &mut Value,
);
fn child_set_property<P: IsA<Actor>>(
&self,
child: &P,
property: &str,
value: &Value,
);
fn create_child_meta<P: IsA<Actor>>(&self, actor: &P);
fn destroy_child_meta<P: IsA<Actor>>(&self, actor: &P);
fn find_child_by_name(&self, child_name: &str) -> Option<Actor>;
fn get_child_meta<P: IsA<Actor>>(&self, actor: &P) -> Option<ChildMeta>;
fn connect_actor_added<F: Fn(&Self, &Actor) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_actor_removed<F: Fn(&Self, &Actor) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_child_notify<F: Fn(&Self, &Actor, &ParamSpec) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}Expand description
Required Methods§
Sourcefn child_get_property<P: IsA<Actor>>(
&self,
child: &P,
property: &str,
value: &mut Value,
)
fn child_get_property<P: IsA<Actor>>( &self, child: &P, property: &str, value: &mut Value, )
Gets a container specific property of a child of self, In general,
a copy is made of the property contents and the caller is responsible for
freeing the memory by calling gobject::Value::unset.
Note that Container::child_set_property is really intended for
language bindings, Container::child_set is much more convenient
for C programming.
§child
a Actor that is a child of self.
§property
the name of the property to set.
§value
the value.
Sourcefn child_set_property<P: IsA<Actor>>(
&self,
child: &P,
property: &str,
value: &Value,
)
fn child_set_property<P: IsA<Actor>>( &self, child: &P, property: &str, value: &Value, )
Calls the ContainerIface.child_notify() virtual function
of Container. The default implementation will emit the
Container::child-notify signal.
§child
a Actor
§pspec
a gobject::ParamSpec
Sets a container-specific property on a child of self.
§child
a Actor that is a child of self.
§property
the name of the property to set.
§value
the value.
Sourcefn create_child_meta<P: IsA<Actor>>(&self, actor: &P)
fn create_child_meta<P: IsA<Actor>>(&self, actor: &P)
Creates the ChildMeta wrapping actor inside the
self, if the ContainerIface::child_meta_type
class member is not set to G_TYPE_INVALID.
This function is only useful when adding a Actor to
a Container implementation outside of the
Container::add() virtual function implementation.
Applications should not call this function.
§actor
a Actor
Sourcefn destroy_child_meta<P: IsA<Actor>>(&self, actor: &P)
fn destroy_child_meta<P: IsA<Actor>>(&self, actor: &P)
Destroys the ChildMeta wrapping actor inside the
self, if any.
This function is only useful when removing a Actor to
a Container implementation outside of the
Container::add() virtual function implementation.
Applications should not call this function.
§actor
a Actor
Sourcefn find_child_by_name(&self, child_name: &str) -> Option<Actor>
fn find_child_by_name(&self, child_name: &str) -> Option<Actor>
Sourcefn connect_actor_added<F: Fn(&Self, &Actor) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_actor_added<F: Fn(&Self, &Actor) + 'static>( &self, f: F, ) -> SignalHandlerId
The ::actor-added signal is emitted each time an actor
has been added to container.
§actor
the new child that has been added to container
Sourcefn connect_actor_removed<F: Fn(&Self, &Actor) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_actor_removed<F: Fn(&Self, &Actor) + 'static>( &self, f: F, ) -> SignalHandlerId
The ::actor-removed signal is emitted each time an actor
is removed from container.
§actor
the child that has been removed from container
Sourcefn connect_child_notify<F: Fn(&Self, &Actor, &ParamSpec) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_child_notify<F: Fn(&Self, &Actor, &ParamSpec) + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.