pub trait WidgetExtManual:
IsA<Widget>
+ Sealed
+ 'static {
// Provided methods
fn drag_dest_set(
&self,
flags: DestDefaults,
targets: &[TargetEntry],
actions: DragAction,
) { ... }
fn drag_source_set(
&self,
start_button_mask: ModifierType,
targets: &[TargetEntry],
actions: DragAction,
) { ... }
fn intersect(
&self,
area: &Rectangle,
intersection: Option<&mut Rectangle>,
) -> bool { ... }
fn connect_map_event<F: Fn(&Self, &Event) -> Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_unmap_event<F: Fn(&Self, &Event) -> Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn add_tick_callback<P: Fn(&Self, &FrameClock) -> ControlFlow + 'static>(
&self,
callback: P,
) -> TickCallbackId { ... }
fn add_events(&self, events: EventMask) { ... }
fn events(&self) -> EventMask { ... }
fn set_events(&self, events: EventMask) { ... }
unsafe fn destroy(&self) { ... }
fn hide_on_delete(&self) -> Propagation { ... }
}Provided Methods§
Sourcefn drag_dest_set(
&self,
flags: DestDefaults,
targets: &[TargetEntry],
actions: DragAction,
)
fn drag_dest_set( &self, flags: DestDefaults, targets: &[TargetEntry], actions: DragAction, )
GDK_CONTROL_MASK) gdk_drag_status (context, GDK_ACTION_COPY, time); else gdk_drag_status (context, GDK_ACTION_MOVE, time); } ]|
§flags
which types of default drag behavior to use
§targets
a pointer to an array of
GtkTargetEntrys indicating the drop types that this self will
accept, or None. Later you can access the list with
WidgetExt::drag_dest_get_target_list() and WidgetExt::drag_dest_find_target().
§actions
a bitmask of possible actions for a drop onto this self.
Sourcefn drag_source_set(
&self,
start_button_mask: ModifierType,
targets: &[TargetEntry],
actions: DragAction,
)
fn drag_source_set( &self, start_button_mask: ModifierType, targets: &[TargetEntry], actions: DragAction, )
Sets up a widget so that GTK+ will start a drag operation when the user clicks and drags on the widget. The widget must have a window.
§start_button_mask
the bitmask of buttons that can start the drag
§targets
the table of targets
that the drag will support, may be None
§actions
the bitmask of possible actions for a drag from this widget
Sourcefn intersect(
&self,
area: &Rectangle,
intersection: Option<&mut Rectangle>,
) -> bool
fn intersect( &self, area: &Rectangle, intersection: Option<&mut Rectangle>, ) -> bool
Computes the intersection of a self’s area and area, storing
the intersection in intersection, and returns true if there was
an intersection. intersection may be None if you’re only
interested in whether there was an intersection.
§area
a rectangle
§Returns
true if there was an intersection
§intersection
rectangle to store
intersection of self and area
Sourcefn connect_map_event<F: Fn(&Self, &Event) -> Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_map_event<F: Fn(&Self, &Event) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId
The ::map-event signal will be emitted when the widget’s window is
mapped. A window is mapped when it becomes visible on the screen.
To receive this signal, the gdk::Window associated to the widget needs
to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask
automatically for all new windows.
§event
the GdkEventAny which triggered this signal.
§Returns
true to stop other handlers from being invoked for the event.
false to propagate the event further.
Sourcefn connect_unmap_event<F: Fn(&Self, &Event) -> Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_unmap_event<F: Fn(&Self, &Event) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId
The ::unmap-event signal will be emitted when the widget’s window is
unmapped. A window is unmapped when it becomes invisible on the screen.
To receive this signal, the gdk::Window associated to the widget needs
to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask
automatically for all new windows.
§event
the GdkEventAny which triggered this signal
§Returns
true to stop other handlers from being invoked for the event.
false to propagate the event further.
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
Queues an animation frame update and adds a callback to be called
before each frame. Until the tick callback is removed, it will be
called frequently (usually at the frame rate of the output device
or as quickly as the application can be repainted, whichever is
slower). For this reason, is most suitable for handling graphics
that change every frame or every few frames. The tick callback does
not automatically imply a relayout or repaint. If you want a
repaint or relayout, and aren’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_area() yourself.
FrameClock::frame_time() should generally be used for timing
continuous animations and
gdk_frame_timings_get_predicted_presentation_time() 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 gdk::FrameClock, since you don’t
have to worry about when a gdk::FrameClock is assigned to a widget.
§callback
function to call for updating animations
§notify
function to call to free user_data when the callback is removed.
§Returns
an id for the connection of this callback. Remove the callback
by passing it to gtk_widget_remove_tick_callback()
Sourcefn add_events(&self, events: EventMask)
fn add_events(&self, events: EventMask)
Adds the events in the bitfield events to the event mask for
self. See WidgetExtManual::set_events() and the
[input handling overview][event-masks] for details.
§events
an event mask, see gdk::EventMask
Sourcefn events(&self) -> EventMask
fn events(&self) -> EventMask
Returns the event mask (see gdk::EventMask) for the widget. These are the
events that the widget will receive.
Note: Internally, the widget event mask will be the logical OR of the event
mask set through WidgetExtManual::set_events() or WidgetExtManual::add_events(), and the
event mask necessary to cater for every EventController created for the
widget.
§Returns
event mask for self
Sourcefn set_events(&self, events: EventMask)
fn set_events(&self, events: EventMask)
Sets the event mask (see gdk::EventMask) for a widget. The event
mask determines which events a widget will receive. Keep in mind
that different widgets have different default event masks, and by
changing the event mask you may disrupt a widget’s functionality,
so be careful. This function must be called while a widget is
unrealized. Consider WidgetExtManual::add_events() for widgets that are
already realized, or if you want to preserve the existing event
mask. This function can’t be used with widgets that have no window.
(See WidgetExt::has_window()). To get events on those widgets,
place them inside a EventBox and receive events on the event
box.
§events
event mask
Sourceunsafe fn destroy(&self)
unsafe fn destroy(&self)
Calls gtk_widget_destroy() on this widget.
§Safety
This will not necessarily entirely remove the widget from existence but you must NOT query the widget’s state subsequently. Do not call this yourself unless you really mean to.
Sourcefn hide_on_delete(&self) -> Propagation
fn hide_on_delete(&self) -> Propagation
Utility function; intended to be connected to the delete-event
signal on a Window. The function calls WidgetExt::hide() on its
argument, then returns true. If connected to ::delete-event, the
result is that clicking the close button for a window (on the
window frame, top right corner usually) will hide but not destroy
the window. By default, GTK+ destroys windows when ::delete-event
is received.
§Returns
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".