pub trait WidgetExtManual: IsA<Widget> + 'static {
// Provided method
fn add_tick_callback<P: Fn(&Self, &FrameClock) -> ControlFlow + 'static>(
&self,
callback: P,
) -> TickCallbackId { ... }
}Expand description
Trait containing manually implemented methods of Widget.
Provided Methods§
Sourcefn add_tick_callback<P: Fn(&Self, &FrameClock) -> ControlFlow + 'static>(
&self,
callback: P,
) -> TickCallbackId
fn add_tick_callback<P: Fn(&Self, &FrameClock) -> ControlFlow + 'static>( &self, callback: P, ) -> TickCallbackId
t changing widget properties
that would trigger that (for example, changing the text of a label),
then you will have to call WidgetExt::queue_resize() or
WidgetExt::queue_draw() yourself.
FrameClock::frame_time() should generally be used
for timing continuous animations and
Gdk::FrameTimings::get_predicted_presentation_time() should be
used if you are trying to display isolated frames at particular times.
This is a more convenient alternative to connecting directly to the
update signal of the frame clock, since you
don’t have to worry about when a frame clock is assigned to a widget.
To remove a tick callback, pass the ID that is returned by this function
to [WidgetExtManual::remove()][crate::prelude::WidgetExtManual::remove()]. Tick callbacks will be
removed automatically when the widget is destroyed, so you do not have
to remove it yourself.
§callback
function to call for updating animations
§Returns
an ID for this callback
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".