Skip to main content

Window

Struct Window 

Source
pub struct Window { /* private fields */ }
Expand description

This is an Abstract Base Class, you cannot instantiate it.

§Properties

§cursor

The mouse pointer for a Window. See Window::set_cursor() and Window::cursor() for details.

Readable | Writeable

§Signals

§create-surface

The ::create-surface signal is emitted when an offscreen window needs its surface (re)created, which happens either when the window is first drawn to, or when the window is being resized. The first signal handler that returns a non-None surface will stop any further signal emission, and its surface will be used.

Note that it is not possible to access the window’s previous surface from within any callback of this signal. Calling gdk_offscreen_window_get_surface() will lead to a crash.

§from-embedder

The ::from-embedder signal is emitted to translate coordinates in the embedder of an offscreen window to the offscreen window.

See also to-embedder.

§moved-to-rect

Emitted when the position of window is finalized after being moved to a destination rectangle.

window might be flipped over the destination rectangle in order to keep it on-screen, in which case flipped_x and flipped_y will be set to true accordingly.

flipped_rect is the ideal position of window after any possible flipping, but before any possible sliding. final_rect is flipped_rect, but possibly translated in the case that flipping is still ineffective in keeping window on-screen.

§pick-embedded-child

The ::pick-embedded-child signal is emitted to find an embedded child at the given position.

§to-embedder

The ::to-embedder signal is emitted to translate coordinates in an offscreen window to its embedder.

See also from-embedder.

§Implements

WindowExtManual

Implementations§

Source§

impl Window

Source

pub fn beep(&self)

Emits a short beep associated to self in the appropriate display, if supported. Otherwise, emits a short beep on the display just as Display::beep().

Source

pub fn begin_draw_frame(&self, region: &Region) -> Option<DrawingContext>

Indicates that you are beginning the process of redrawing region on self, and provides you with a DrawingContext.

If self is a top level Window, backed by a native window implementation, a backing store (offscreen buffer) large enough to contain region will be created. The backing store will be initialized with the background color or background surface for self. Then, all drawing operations performed on self will be diverted to the backing store. When you call gdk_window_end_frame(), the contents of the backing store will be copied to self, making it visible on screen. Only the part of self contained in region will be modified; that is, drawing operations are clipped to region.

The net result of all this is to remove flicker, because the user sees the finished product appear all at once when you call end_draw_frame(). If you draw to self directly without calling begin_draw_frame(), the user may see flicker as individual drawing operations are performed in sequence.

When using GTK+, the widget system automatically places calls to begin_draw_frame() and end_draw_frame() around emissions of the GtkWidget::draw signal. That is, if you’re drawing the contents of the widget yourself, you can assume that the widget has a cleared background, is already set as the clip region, and already has a backing store. Therefore in most cases, application code in GTK does not need to call begin_draw_frame() explicitly.

§region

a Cairo region

§Returns

a DrawingContext context that should be used to draw the contents of the window; the returned context is owned by GDK.

Source

pub fn begin_move_drag( &self, button: i32, root_x: i32, root_y: i32, timestamp: u32, )

Begins a window move operation (for a toplevel window).

This function assumes that the drag is controlled by the client pointer device, use begin_move_drag_for_device() to begin a drag with a different device.

§button

the button being used to drag, or 0 for a keyboard-initiated drag

§root_x

root window X coordinate of mouse click that began the drag

§root_y

root window Y coordinate of mouse click that began the drag

§timestamp

timestamp of mouse click that began the drag

Source

pub fn begin_move_drag_for_device( &self, device: &impl IsA<Device>, button: i32, root_x: i32, root_y: i32, timestamp: u32, )

Begins a window move operation (for a toplevel window). You might use this function to implement a “window move grip,” for example. The function works best with window managers that support the Extended Window Manager Hints but has a fallback implementation for other window managers.

§device

the device used for the operation

§button

the button being used to drag, or 0 for a keyboard-initiated drag

§root_x

root window X coordinate of mouse click that began the drag

§root_y

root window Y coordinate of mouse click that began the drag

§timestamp

timestamp of mouse click that began the drag

Source

pub fn begin_resize_drag( &self, edge: WindowEdge, button: i32, root_x: i32, root_y: i32, timestamp: u32, )

Begins a window resize operation (for a toplevel window).

This function assumes that the drag is controlled by the client pointer device, use begin_resize_drag_for_device() to begin a drag with a different device.

§edge

the edge or corner from which the drag is started

§button

the button being used to drag, or 0 for a keyboard-initiated drag

§root_x

root window X coordinate of mouse click that began the drag

§root_y

root window Y coordinate of mouse click that began the drag

§timestamp

timestamp of mouse click that began the drag (use gdk_event_get_time())

Source

pub fn begin_resize_drag_for_device( &self, edge: WindowEdge, device: &impl IsA<Device>, button: i32, root_x: i32, root_y: i32, timestamp: u32, )

Begins a window resize operation (for a toplevel window). You might use this function to implement a “window resize grip,” for example; in fact GtkStatusbar uses it. The function works best with window managers that support the Extended Window Manager Hints but has a fallback implementation for other window managers.

§edge

the edge or corner from which the drag is started

§device

the device used for the operation

§button

the button being used to drag, or 0 for a keyboard-initiated drag

§root_x

root window X coordinate of mouse click that began the drag

§root_y

root window Y coordinate of mouse click that began the drag

§timestamp

timestamp of mouse click that began the drag (use gdk_event_get_time())

Source

pub fn coords_from_parent(&self, parent_x: f64, parent_y: f64) -> (f64, f64)

Transforms window coordinates from a parent window to a child window, where the parent window is the normal parent as returned by parent() for normal windows, and the window’s embedder as returned by gdk_offscreen_window_get_embedder() for offscreen windows.

For normal windows, calling this function is equivalent to subtracting the return values of position() from the parent coordinates. For offscreen windows however (which can be arbitrarily transformed), this function calls the GdkWindow::from-embedder: signal to translate the coordinates.

You should always use this function when writing generic code that walks down a window hierarchy.

See also: coords_to_parent()

§parent_x

X coordinate in parent’s coordinate system

§parent_y

Y coordinate in parent’s coordinate system

§Returns
§x

return location for X coordinate in child’s coordinate system

§y

return location for Y coordinate in child’s coordinate system

Source

pub fn coords_to_parent(&self, x: f64, y: f64) -> (f64, f64)

Transforms window coordinates from a child window to its parent window, where the parent window is the normal parent as returned by parent() for normal windows, and the window’s embedder as returned by gdk_offscreen_window_get_embedder() for offscreen windows.

For normal windows, calling this function is equivalent to adding the return values of position() to the child coordinates. For offscreen windows however (which can be arbitrarily transformed), this function calls the GdkWindow::to-embedder: signal to translate the coordinates.

You should always use this function when writing generic code that walks up a window hierarchy.

See also: coords_from_parent()

§x

X coordinate in child’s coordinate system

§y

Y coordinate in child’s coordinate system

§Returns
§parent_x

return location for X coordinate in parent’s coordinate system, or None

§parent_y

return location for Y coordinate in parent’s coordinate system, or None

Source

pub fn create_gl_context(&self) -> Result<GLContext, Error>

Creates a new GLContext matching the framebuffer format to the visual of the Window. The context is disconnected from any particular window or surface.

If the creation of the GLContext failed, error will be set.

Before using the returned GLContext, you will need to call GLContext::make_current() or GLContext::realize().

§Returns

the newly created GLContext, or None on error

Source

pub fn deiconify(&self)

Attempt to deiconify (unminimize) self. On X11 the window manager may choose to ignore the request to deiconify. When using GTK+, use gtk_window_deiconify() instead of the Window variant. Or better yet, you probably want to use gtk_window_present_with_time(), which raises the window, focuses it, unminimizes it, and puts it on the current desktop.

Source

pub fn destroy(&self)

Source

pub fn destroy_notify(&self)

Source

pub fn end_draw_frame(&self, context: &DrawingContext)

Indicates that the drawing of the contents of self started with gdk_window_begin_frame() has been completed.

This function will take care of destroying the DrawingContext.

It is an error to call this function without a matching gdk_window_begin_frame() first.

§context

the DrawingContext created by begin_draw_frame()

Source

pub fn end_paint(&self)

Indicates that the backing store created by the most recent call to gdk_window_begin_paint_region() should be copied onscreen and deleted, leaving the next-most-recent backing store or no backing store at all as the active paint region. See gdk_window_begin_paint_region() for full details.

It is an error to call this function without a matching gdk_window_begin_paint_region() first.

Source

pub fn ensure_native(&self) -> bool

Tries to ensure that there is a window-system native window for this GdkWindow. This may fail in some situations, returning false.

Offscreen window and children of them can never have native windows.

Some backends may not support native child windows.

§Returns

true if the window has a native window, false otherwise

Source

pub fn focus(&self, timestamp: u32)

Sets keyboard focus to self. In most cases, gtk_window_present_with_time() should be used on a GtkWindow, rather than calling this function.

§timestamp

timestamp of the event triggering the window focus

Source

pub fn freeze_updates(&self)

Temporarily freezes a window such that it won’t receive expose events. The window will begin receiving expose events again when thaw_updates() is called. If freeze_updates() has been called more than once, thaw_updates() must be called an equal number of times to begin processing exposes.

Source

pub fn fullscreen(&self)

Moves the window into fullscreen mode. This means the window covers the entire screen and is above any panels or task bars.

If the window was already fullscreen, then this function does nothing.

On X11, asks the window manager to put self in a fullscreen state, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “fullscreen”; so you can’t rely on the fullscreenification actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

Source

pub fn fullscreen_on_monitor(&self, monitor: i32)

Moves the window into fullscreen mode on the given monitor. This means the window covers the entire screen and is above any panels or task bars.

If the window was already fullscreen, then this function does nothing.

§monitor

Which monitor to display fullscreen on.

Source

pub fn geometry_changed(&self)

This function informs GDK that the geometry of an embedded offscreen window has changed. This is necessary for GDK to keep track of which offscreen window the pointer is in.

Source

pub fn accepts_focus(&self) -> bool

Determines whether or not the desktop environment shuld be hinted that the window does not want to receive input focus.

§Returns

whether or not the window should receive input focus.

Source

pub fn children(&self) -> Vec<Window>

Gets the list of children of self known to GDK. This function only returns children created via GDK, so for example it’s useless when used with the root window; it only returns windows an application created itself.

The returned list must be freed, but the elements in the list need not be.

§Returns

list of child windows inside self

Source

pub fn clip_region(&self) -> Option<Region>

Computes the region of a window that potentially can be written to by drawing primitives. This region may not take into account other factors such as if the window is obscured by other windows, but no area outside of this region will be affected by drawing primitives.

§Returns

a cairo::Region. This must be freed with cairo_region_destroy() when you are done.

Source

pub fn cursor(&self) -> Option<Cursor>

Retrieves a Cursor pointer for the cursor currently set on the specified Window, or None. If the return value is None then there is no custom cursor set on the specified window, and it is using the cursor for its parent window.

§Returns

a Cursor, or None. The returned object is owned by the Window and should not be unreferenced directly. Use set_cursor() to unset the cursor of the window

Source

pub fn decorations(&self) -> Option<WMDecoration>

Returns the decorations set on the GdkWindow with set_decorations().

§Returns

true if the window has decorations set, false otherwise.

§decorations

The window decorations will be written here

Source

pub fn device_cursor(&self, device: &impl IsA<Device>) -> Option<Cursor>

Retrieves a Cursor pointer for the device currently set on the specified Window, or None. If the return value is None then there is no custom cursor set on the specified window, and it is using the cursor for its parent window.

§device

a master, pointer Device.

§Returns

a Cursor, or None. The returned object is owned by the Window and should not be unreferenced directly. Use set_cursor() to unset the cursor of the window

Source

pub fn device_events(&self, device: &impl IsA<Device>) -> EventMask

Returns the event mask for self corresponding to an specific device.

§device

a Device.

§Returns

device event mask for self

Source

pub fn device_position( &self, device: &impl IsA<Device>, ) -> (Option<Window>, i32, i32, ModifierType)

Obtains the current device position and modifier state. The position is given in coordinates relative to the upper left corner of self.

Use device_position_double() if you need subpixel precision.

§device

pointer Device to query to.

§Returns

The window underneath device (as with DeviceExt::window_at_position()), or None if the window is not known to GDK.

§x

return location for the X coordinate of device, or None.

§y

return location for the Y coordinate of device, or None.

§mask

return location for the modifier mask, or None.

Source

pub fn device_position_double( &self, device: &impl IsA<Device>, ) -> (Option<Window>, f64, f64, ModifierType)

Obtains the current device position in doubles and modifier state. The position is given in coordinates relative to the upper left corner of self.

§device

pointer Device to query to.

§Returns

The window underneath device (as with DeviceExt::window_at_position()), or None if the window is not known to GDK.

§x

return location for the X coordinate of device, or None.

§y

return location for the Y coordinate of device, or None.

§mask

return location for the modifier mask, or None.

Source

pub fn display(&self) -> Display

Gets the Display associated with a Window.

§Returns

the Display associated with self

Source

pub fn drag_protocol(&self) -> (DragProtocol, Window)

Finds out the DND protocol supported by a window.

§Returns

the supported DND protocol.

§target

location of the window where the drop should happen. This may be self or a proxy window, or None if self does not support Drag and Drop.

Source

pub fn effective_parent(&self) -> Option<Window>

Obtains the parent of self, as known to GDK. Works like parent() for normal windows, but returns the window’s embedder for offscreen windows.

See also: gdk_offscreen_window_get_embedder()

§Returns

effective parent of self

Source

pub fn effective_toplevel(&self) -> Window

Gets the toplevel window that’s an ancestor of self.

Works like toplevel(), but treats an offscreen window’s embedder as its parent, using effective_parent().

See also: gdk_offscreen_window_get_embedder()

§Returns

the effective toplevel window containing self

Source

pub fn does_event_compression(&self) -> bool

Get the current event compression setting for this window.

§Returns

true if motion events will be compressed

Source

pub fn events(&self) -> EventMask

Gets the event mask for self for all master input devices. See set_events().

§Returns

event mask for self

Source

pub fn gets_focus_on_map(&self) -> bool

Determines whether or not the desktop environment should be hinted that the window does not want to receive input focus when it is mapped.

§Returns

whether or not the window wants to receive input focus when it is mapped.

Source

pub fn frame_clock(&self) -> Option<FrameClock>

Gets the frame clock for the window. The frame clock for a window never changes unless the window is reparented to a new toplevel window.

§Returns

the frame clock

Source

pub fn frame_extents(&self) -> Rectangle

Obtains the bounding box of the window, including window manager titlebar/borders if any. The frame position is given in root window coordinates. To get the position of the window itself (rather than the frame) in root window coordinates, use origin().

§Returns
§rect

rectangle to fill with bounding box of the window frame

Source

pub fn fullscreen_mode(&self) -> FullscreenMode

Obtains the FullscreenMode of the self.

§Returns

The FullscreenMode applied to the window when fullscreen.

Source

pub fn geometry(&self) -> (i32, i32, i32, i32)

Any of the return location arguments to this function may be None, if you aren’t interested in getting the value of that field.

The X and Y coordinates returned are relative to the parent window of self, which for toplevels usually means relative to the window decorations (titlebar, etc.) rather than relative to the root window (screen-size background window).

On the X11 platform, the geometry is obtained from the X server, so reflects the latest position of self; this may be out-of-sync with the position of self delivered in the most-recently-processed EventConfigure. position() in contrast gets the position from the most recent configure event.

Note: If self is not a toplevel, it is much better to call position(), width() and height() instead, because it avoids the roundtrip to the X server and because these functions support the full 32-bit coordinate space, whereas geometry() is restricted to the 16-bit coordinates of X11.

§Returns
§x

return location for X coordinate of window (relative to its parent)

§y

return location for Y coordinate of window (relative to its parent)

§width

return location for width of window

§height

return location for height of window

Source

pub fn group(&self) -> Option<Window>

Returns the group leader window for self. See set_group().

§Returns

the group leader window for self

Source

pub fn height(&self) -> i32

Returns the height of the given self.

On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.

§Returns

The height of self

Source

pub fn is_modal_hint(&self) -> bool

Determines whether or not the window manager is hinted that self has modal behaviour.

§Returns

whether or not the window has the modal hint set.

Source

pub fn origin(&self) -> (i32, i32, i32)

Obtains the position of a window in root window coordinates. (Compare with position() and geometry() which return the position of a window relative to its parent window.)

§Returns

not meaningful, ignore

§x

return location for X coordinate

§y

return location for Y coordinate

Source

pub fn parent(&self) -> Option<Window>

Obtains the parent of self, as known to GDK. Does not query the X server; thus this returns the parent as passed to new(), not the actual parent. This should never matter unless you’re using Xlib calls mixed with GDK calls on the X11 platform. It may also matter for toplevel windows, because the window manager may choose to reparent them.

Note that you should use effective_parent() when writing generic code that walks up a window hierarchy, because parent() will most likely not do what you expect if there are offscreen windows in the hierarchy.

§Returns

parent of self

Source

pub fn is_pass_through(&self) -> bool

Returns whether input to the window is passed through to the window below.

See set_pass_through() for details

Source

pub fn position(&self) -> (i32, i32)

Obtains the position of the window as reported in the most-recently-processed EventConfigure. Contrast with geometry() which queries the X server for the current window position, regardless of which events have been received or processed.

The position coordinates are relative to the window’s parent window.

§Returns
§x

X coordinate of window

§y

Y coordinate of window

Source

pub fn root_coords(&self, x: i32, y: i32) -> (i32, i32)

Obtains the position of a window position in root window coordinates. This is similar to origin() but allows you to pass in any position in the window, not just the origin.

§x

X coordinate in window

§y

Y coordinate in window

§Returns
§root_x

return location for X coordinate

§root_y

return location for Y coordinate

Source

pub fn root_origin(&self) -> (i32, i32)

Obtains the top-left corner of the window manager frame in root window coordinates.

§Returns
§x

return location for X position of window frame

§y

return location for Y position of window frame

Source

pub fn scale_factor(&self) -> i32

Returns the internal scale factor that maps from window coordiantes to the actual device pixels. On traditional systems this is 1, but on very high density outputs this can be a higher value (often 2).

A higher value means that drawing is automatically scaled up to a higher resolution, so any code doing drawing will automatically look nicer. However, if you are supplying pixel-based data the scale value can be used to determine whether to use a pixel resource with higher resolution data.

The scale of a window may change during runtime, if this happens a configure event will be sent to the toplevel window.

§Returns

the scale factor

Source

pub fn screen(&self) -> Screen

Gets the Screen associated with a Window.

§Returns

the Screen associated with self

Source

pub fn source_events(&self, source: InputSource) -> EventMask

Returns the event mask for self corresponding to the device class specified by source.

§source

a InputSource to define the source class.

§Returns

source event mask for self

Source

pub fn state(&self) -> WindowState

Gets the bitwise OR of the currently active window state flags, from the WindowState enumeration.

§Returns

window state bitfield

Source

pub fn supports_multidevice(&self) -> bool

Returns true if the window is aware of the existence of multiple devices.

§Returns

true if the window handles multidevice features.

Source

pub fn toplevel(&self) -> Window

Gets the toplevel window that’s an ancestor of self.

Any window type but WindowType::Child is considered a toplevel window, as is a WindowType::Child window that has a root window as parent.

Note that you should use effective_toplevel() when you want to get to a window’s toplevel as seen on screen, because toplevel() will most likely not do what you expect if there are offscreen windows in the hierarchy.

§Returns

the toplevel window containing self

Source

pub fn type_hint(&self) -> WindowTypeHint

This function returns the type hint set for a window.

§Returns

The type hint set for self

Source

pub fn update_area(&self) -> Option<Region>

Transfers ownership of the update area from self to the caller of the function. That is, after calling this function, self will no longer have an invalid/dirty region; the update area is removed from self and handed to you. If a window has no update area, update_area() returns None. You are responsible for calling cairo_region_destroy() on the returned region if it’s non-None.

§Returns

the update area for self

Source

pub fn visible_region(&self) -> Option<Region>

Computes the region of the self that is potentially visible. This does not necessarily take into account if the window is obscured by other windows, but no area outside of this region is visible.

§Returns

a cairo::Region. This must be freed with cairo_region_destroy() when you are done.

Source

pub fn visual(&self) -> Visual

Gets the Visual describing the pixel format of self.

§Returns

a Visual

Source

pub fn width(&self) -> i32

Returns the width of the given self.

On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.

§Returns

The width of self

Source

pub fn window_type(&self) -> WindowType

Gets the type of the window. See WindowType.

§Returns

type of window

Source

pub fn has_native(&self) -> bool

Checks whether the window has a native window or not. Note that you can use ensure_native() if a native window is needed.

§Returns

true if the self has a native window, false otherwise.

Source

pub fn hide(&self)

For toplevel windows, withdraws them, so they will no longer be known to the window manager; for all windows, unmaps them, so they won’t be displayed. Normally done automatically as part of gtk_widget_hide().

Source

pub fn iconify(&self)

Asks to iconify (minimize) self. The window manager may choose to ignore the request, but normally will honor it. Using gtk_window_iconify() is preferred, if you have a GtkWindow widget.

This function only makes sense when self is a toplevel window.

Source

pub fn input_shape_combine_region( &self, shape_region: &Region, offset_x: i32, offset_y: i32, )

Like shape_combine_region(), but the shape applies only to event handling. Mouse events which happen while the pointer position corresponds to an unset bit in the mask will be passed on the window below self.

An input shape is typically used with RGBA windows. The alpha channel of the window defines which pixels are invisible and allows for nicely antialiased borders, and the input shape controls where the window is “clickable”.

On the X11 platform, this requires version 1.1 of the shape extension.

On the Win32 platform, this functionality is not present and the function does nothing.

§shape_region

region of window to be non-transparent

§offset_x

X position of shape_region in self coordinates

§offset_y

Y position of shape_region in self coordinates

Source

pub fn invalidate_maybe_recurse( &self, region: &Region, child_func: Option<&mut dyn FnMut(&Window) -> bool>, )

Adds region to the update area for self. The update area is the region that needs to be redrawn, or “dirty region.” The call gdk_window_process_updates() sends one or more expose events to the window, which together cover the entire update area. An application would normally redraw the contents of self in response to those expose events.

GDK will call gdk_window_process_all_updates() on your behalf whenever your program returns to the main loop and becomes idle, so normally there’s no need to do that manually, you just need to invalidate regions that you know should be redrawn.

The child_func parameter controls whether the region of each child window that intersects region will also be invalidated. Only children for which child_func returns true will have the area invalidated.

§region

a cairo::Region

§child_func

function to use to decide if to recurse to a child, None means never recurse.

Source

pub fn invalidate_rect( &self, rect: Option<&Rectangle>, invalidate_children: bool, )

A convenience wrapper around invalidate_region() which invalidates a rectangular region. See invalidate_region() for details.

§rect

rectangle to invalidate or None to invalidate the whole window

§invalidate_children

whether to also invalidate child windows

Source

pub fn invalidate_region(&self, region: &Region, invalidate_children: bool)

Adds region to the update area for self. The update area is the region that needs to be redrawn, or “dirty region.” The call gdk_window_process_updates() sends one or more expose events to the window, which together cover the entire update area. An application would normally redraw the contents of self in response to those expose events.

GDK will call gdk_window_process_all_updates() on your behalf whenever your program returns to the main loop and becomes idle, so normally there’s no need to do that manually, you just need to invalidate regions that you know should be redrawn.

The invalidate_children parameter controls whether the region of each child window that intersects region will also be invalidated. If false, then the update area for child windows will remain unaffected. See gdk_window_invalidate_maybe_recurse if you need fine grained control over which children are invalidated.

§region

a cairo::Region

§invalidate_children

true to also invalidate child windows

Source

pub fn is_destroyed(&self) -> bool

Check to see if a window is destroyed..

§Returns

true if the window is destroyed

Source

pub fn is_input_only(&self) -> bool

Determines whether or not the window is an input only window.

§Returns

true if self is input only

Source

pub fn is_shaped(&self) -> bool

Determines whether or not the window is shaped.

§Returns

true if self is shaped

Source

pub fn is_viewable(&self) -> bool

Check if the window and all ancestors of the window are mapped. (This is not necessarily “viewable” in the X sense, since we only check as far as we have GDK window parents, not to the root window.)

§Returns

true if the window is viewable

Source

pub fn is_visible(&self) -> bool

Checks whether the window has been mapped (with show() or show_unraised()).

§Returns

true if the window is mapped

Source

pub fn lower(&self)

Lowers self to the bottom of the Z-order (stacking order), so that other windows with the same parent window appear above self. This is true whether or not the other windows are visible.

If self is a toplevel, the window manager may choose to deny the request to move the window in the Z-order, lower() only requests the restack, does not guarantee it.

Note that show() raises the window again, so don’t call this function before show(). (Try show_unraised().)

Source

pub fn mark_paint_from_clip(&self, cr: &Context)

If you call this during a paint (e.g. between gdk_window_begin_paint_region() and end_paint() then GDK will mark the current clip region of the window as being drawn. This is required when mixing GL rendering via gdk_cairo_draw_from_gl() and cairo rendering, as otherwise GDK has no way of knowing when something paints over the GL-drawn regions.

This is typically called automatically by GTK+ and you don’t need to care about this.

§cr

a cairo::Context

Source

pub fn maximize(&self)

Maximizes the window. If the window was already maximized, then this function does nothing.

On X11, asks the window manager to maximize self, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “maximized”; so you can’t rely on the maximization actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

On Windows, reliably maximizes the window.

Source

pub fn merge_child_input_shapes(&self)

Merges the input shape masks for any child windows into the input shape mask for self. i.e. the union of all input masks for self and its children will become the new input mask for self. See input_shape_combine_region().

This function is distinct from set_child_input_shapes() because it includes self’s input shape mask in the set of shapes to be merged.

Source

pub fn merge_child_shapes(&self)

Merges the shape masks for any child windows into the shape mask for self. i.e. the union of all masks for self and its children will become the new mask for self. See shape_combine_region().

This function is distinct from set_child_shapes() because it includes self’s shape mask in the set of shapes to be merged.

Source

pub fn move_(&self, x: i32, y: i32)

Source

pub fn move_region(&self, region: &Region, dx: i32, dy: i32)

Move the part of self indicated by region by dy pixels in the Y direction and dx pixels in the X direction. The portions of region that not covered by the new position of region are invalidated.

Child windows are not moved.

§region

The cairo::Region to move

§dx

Amount to move in the X direction

§dy

Amount to move in the Y direction

Source

pub fn move_resize(&self, x: i32, y: i32, width: i32, height: i32)

Equivalent to calling move_() and resize(), except that both operations are performed at once, avoiding strange visual effects. (i.e. the user may be able to see the window first move, then resize, if you don’t use move_resize().)

§x

new X position relative to window’s parent

§y

new Y position relative to window’s parent

§width

new width

§height

new height

Source

pub fn move_to_rect( &self, rect: &Rectangle, rect_anchor: Gravity, window_anchor: Gravity, anchor_hints: AnchorHints, rect_anchor_dx: i32, rect_anchor_dy: i32, )

Available on crate feature v3_24 only.

Moves self to rect, aligning their anchor points.

rect is relative to the top-left corner of the window that self is transient for. rect_anchor and window_anchor determine anchor points on rect and self to pin together. rect’s anchor point can optionally be offset by rect_anchor_dx and rect_anchor_dy, which is equivalent to offsetting the position of self.

anchor_hints determines how self will be moved if the anchor points cause it to move off-screen. For example, AnchorHints::FLIP_X will replace Gravity::NorthWest with Gravity::NorthEast and vice versa if self extends beyond the left or right edges of the monitor.

Connect to the moved-to-rect signal to find out how it was actually positioned.

§rect

the destination Rectangle to align self with

§rect_anchor

the point on rect to align with self’s anchor point

§window_anchor

the point on self to align with rect’s anchor point

§anchor_hints

positioning hints to use when limited on space

§rect_anchor_dx

horizontal offset to shift self, i.e. rect’s anchor point

§rect_anchor_dy

vertical offset to shift self, i.e. rect’s anchor point

Source

pub fn peek_children(&self) -> Vec<Window>

Like children(), but does not copy the list of children, so the list does not need to be freed.

§Returns

a reference to the list of child windows in self

Source

pub fn raise(&self)

Raises self to the top of the Z-order (stacking order), so that other windows with the same parent window appear below self. This is true whether or not the windows are visible.

If self is a toplevel, the window manager may choose to deny the request to move the window in the Z-order, raise() only requests the restack, does not guarantee it.

Source

pub fn register_dnd(&self)

Registers a window as a potential drop destination.

Source

pub fn reparent(&self, new_parent: &Window, x: i32, y: i32)

Reparents self into the given new_parent. The window being reparented will be unmapped as a side effect.

§new_parent

new parent to move self into

§x

X location inside the new parent

§y

Y location inside the new parent

Source

pub fn resize(&self, width: i32, height: i32)

Resizes self; for toplevel windows, asks the window manager to resize the window. The window manager may not allow the resize. When using GTK+, use gtk_window_resize() instead of this low-level GDK function.

Windows may not be resized below 1x1.

If you’re also planning to move the window, use move_resize() to both move and resize simultaneously, for a nicer visual effect.

§width

new width of the window

§height

new height of the window

Source

pub fn restack(&self, sibling: Option<&Window>, above: bool)

Changes the position of self in the Z-order (stacking order), so that it is above sibling (if above is true) or below sibling (if above is false).

If sibling is None, then this either raises (if above is true) or lowers the window.

If self is a toplevel, the window manager may choose to deny the request to move the window in the Z-order, restack() only requests the restack, does not guarantee it.

§sibling

a Window that is a sibling of self, or None

§above

a boolean

Source

pub fn scroll(&self, dx: i32, dy: i32)

Scroll the contents of self, both pixels and children, by the given amount. self itself does not move. Portions of the window that the scroll operation brings in from offscreen areas are invalidated. The invalidated region may be bigger than what would strictly be necessary.

For X11, a minimum area will be invalidated if the window has no subwindows, or if the edges of the window’s parent do not extend beyond the edges of the window. In other cases, a multi-step process is used to scroll the window which may produce temporary visual artifacts and unnecessary invalidations.

§dx

Amount to scroll in the X direction

§dy

Amount to scroll in the Y direction

Source

pub fn set_accept_focus(&self, accept_focus: bool)

Setting accept_focus to false hints the desktop environment that the window doesn’t want to receive input focus.

On X, it is the responsibility of the window manager to interpret this hint. ICCCM-compliant window manager usually respect it.

§accept_focus

true if the window should receive input focus

Source

pub fn set_child_input_shapes(&self)

Sets the input shape mask of self to the union of input shape masks for all children of self, ignoring the input shape mask of self itself. Contrast with merge_child_input_shapes() which includes the input shape mask of self in the masks to be merged.

Source

pub fn set_child_shapes(&self)

Sets the shape mask of self to the union of shape masks for all children of self, ignoring the shape mask of self itself. Contrast with merge_child_shapes() which includes the shape mask of self in the masks to be merged.

Source

pub fn set_cursor(&self, cursor: Option<&Cursor>)

Sets the default mouse pointer for a Window.

Note that cursor must be for the same display as self.

Use Cursor::for_display() or Cursor::from_pixbuf() to create the cursor. To make the cursor invisible, use CursorType::BlankCursor. Passing None for the cursor argument to set_cursor() means that self will use the cursor of its parent window. Most windows should use this default.

§cursor

a cursor

Source

pub fn set_decorations(&self, decorations: WMDecoration)

“Decorations” are the features the window manager adds to a toplevel Window. This function sets the traditional Motif window manager hints that tell the window manager which decorations you would like your window to have. Usually you should use gtk_window_set_decorated() on a GtkWindow instead of using the GDK function directly.

The decorations argument is the logical OR of the fields in the WMDecoration enumeration. If WMDecoration::ALL is included in the mask, the other bits indicate which decorations should be turned off. If WMDecoration::ALL is not included, then the other bits indicate which decorations should be turned on.

Most window managers honor a decorations hint of 0 to disable all decorations, but very few honor all possible combinations of bits.

§decorations

decoration hint mask

Source

pub fn set_device_cursor(&self, device: &impl IsA<Device>, cursor: &Cursor)

Sets a specific Cursor for a given device when it gets inside self. Use Cursor::for_display() or Cursor::from_pixbuf() to create the cursor. To make the cursor invisible, use CursorType::BlankCursor. Passing None for the cursor argument to set_cursor() means that self will use the cursor of its parent window. Most windows should use this default.

§device

a master, pointer Device

§cursor

a Cursor

Source

pub fn set_device_events( &self, device: &impl IsA<Device>, event_mask: EventMask, )

Sets the event mask for a given device (Normally a floating device, not attached to any visible pointer) to self. For example, an event mask including EventMask::BUTTON_PRESS_MASK means the window should report button press events. The event mask is the bitwise OR of values from the EventMask enumeration.

See the [input handling overview][event-masks] for details.

§device

Device to enable events for.

§event_mask

event mask for self

Source

pub fn set_event_compression(&self, event_compression: bool)

Determines whether or not extra unprocessed motion events in the event queue can be discarded. If true only the most recent event will be delivered.

Some types of applications, e.g. paint programs, need to see all motion events and will benefit from turning off event compression.

By default, event compression is enabled.

§event_compression

true if motion events should be compressed

Source

pub fn set_events(&self, event_mask: EventMask)

The event mask for a window determines which events will be reported for that window from all master input devices. For example, an event mask including EventMask::BUTTON_PRESS_MASK means the window should report button press events. The event mask is the bitwise OR of values from the EventMask enumeration.

See the [input handling overview][event-masks] for details.

§event_mask

event mask for self

Source

pub fn set_focus_on_map(&self, focus_on_map: bool)

Setting focus_on_map to false hints the desktop environment that the window doesn’t want to receive input focus when it is mapped. focus_on_map should be turned off for windows that aren’t triggered interactively (such as popups from network activity).

On X, it is the responsibility of the window manager to interpret this hint. Window managers following the freedesktop.org window manager extension specification should respect it.

§focus_on_map

true if the window should receive input focus when mapped

Source

pub fn set_fullscreen_mode(&self, mode: FullscreenMode)

Specifies whether the self should span over all monitors (in a multi-head setup) or only the current monitor when in fullscreen mode.

The mode argument is from the FullscreenMode enumeration. If FullscreenMode::AllMonitors is specified, the fullscreen self will span over all monitors from the Screen.

On X11, searches through the list of monitors from the Screen the ones which delimit the 4 edges of the entire Screen and will ask the window manager to span the self over these monitors.

If the XINERAMA extension is not available or not usable, this function has no effect.

Not all window managers support this, so you can’t rely on the fullscreen window to span over the multiple monitors when FullscreenMode::AllMonitors is specified.

§mode

fullscreen mode

Source

pub fn set_functions(&self, functions: WMFunction)

Sets hints about the window management functions to make available via buttons on the window frame.

On the X backend, this function sets the traditional Motif window manager hint for this purpose. However, few window managers do anything reliable or interesting with this hint. Many ignore it entirely.

The functions argument is the logical OR of values from the WMFunction enumeration. If the bitmask includes WMFunction::ALL, then the other bits indicate which functions to disable; if it doesn’t include WMFunction::ALL, it indicates which functions to enable.

§functions

bitmask of operations to allow on self

Source

pub fn set_geometry_hints(&self, geometry: &Geometry, geom_mask: WindowHints)

Sets the geometry hints for self. Hints flagged in geom_mask are set, hints not flagged in geom_mask are unset. To unset all hints, use a geom_mask of 0 and a geometry of None.

This function provides hints to the windowing system about acceptable sizes for a toplevel window. The purpose of this is to constrain user resizing, but the windowing system will typically (but is not required to) also constrain the current size of the window to the provided values and constrain programatic resizing via resize() or move_resize().

Note that on X11, this effect has no effect on windows of type WindowType::Temp or windows where override redirect has been turned on via set_override_redirect() since these windows are not resizable by the user.

Since you can’t count on the windowing system doing the constraints for programmatic resizes, you should generally call constrain_size() yourself to determine appropriate sizes.

§geometry

geometry hints

§geom_mask

bitmask indicating fields of geometry to pay attention to

Source

pub fn set_group(&self, leader: Option<&Window>)

Sets the group leader window for self. By default, GDK sets the group leader for all toplevel windows to a global window implicitly created by GDK. With this function you can override this default.

The group leader window allows the window manager to distinguish all windows that belong to a single application. It may for example allow users to minimize/unminimize all windows belonging to an application at once. You should only set a non-default group window if your application pretends to be multiple applications.

§leader

group leader window, or None to restore the default group leader window

Source

pub fn set_icon_list(&self, pixbufs: &[Pixbuf])

Sets a list of icons for the window. One of these will be used to represent the window when it has been iconified. The icon is usually shown in an icon box or some sort of task bar. Which icon size is shown depends on the window manager. The window manager can scale the icon but setting several size icons can give better image quality since the window manager may only need to scale the icon by a small amount or not at all.

Note that some platforms don’t support window icons.

§pixbufs

A list of pixbufs, of different sizes.

Source

pub fn set_icon_name(&self, name: Option<&str>)

Windows may have a name used while minimized, distinct from the name they display in their titlebar. Most of the time this is a bad idea from a user interface standpoint. But you can set such a name with this function, if you like.

After calling this with a non-None name, calls to set_title() will not update the icon title.

Using None for name unsets the icon title; further calls to set_title() will again update the icon title as well.

Note that some platforms don’t support window icons.

§name

name of window while iconified (minimized)

Source

pub fn set_keep_above(&self, setting: bool)

Set if self must be kept above other windows. If the window was already above, then this function does nothing.

On X11, asks the window manager to keep self above, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “keep above”; so you can’t rely on the window being kept above. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

§setting

whether to keep self above other windows

Source

pub fn set_keep_below(&self, setting: bool)

Set if self must be kept below other windows. If the window was already below, then this function does nothing.

On X11, asks the window manager to keep self below, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “keep below”; so you can’t rely on the window being kept below. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

§setting

whether to keep self below other windows

Source

pub fn set_modal_hint(&self, modal: bool)

The application can use this hint to tell the window manager that a certain window has modal behaviour. The window manager can use this information to handle modal windows in a special way.

You should only use this on windows for which you have previously called set_transient_for()

true if the window is modal, false otherwise.

Source

pub fn set_opacity(&self, opacity: f64)

Set self to render as partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Values of the opacity parameter are clamped to the [0,1] range.)

For toplevel windows this depends on support from the windowing system that may not always be there. For instance, On X11, this works only on X screens with a compositing manager running. On Wayland, there is no per-window opacity value that the compositor would apply. Instead, use gdk_window_set_opaque_region (window, NULL) to tell the compositor that the entire window is (potentially) non-opaque, and draw your content with alpha, or use gtk_widget_set_opacity() to set an overall opacity for your widgets.

For child windows this function only works for non-native windows.

For setting up per-pixel alpha topelevels, see Screen::rgba_visual(), and for non-toplevels, see gdk_window_set_composited().

Support for non-toplevel windows was added in 3.8.

§opacity

opacity

Source

pub fn set_opaque_region(&self, region: Option<&Region>)

For optimisation purposes, compositing window managers may like to not draw obscured regions of windows, or turn off blending during for these regions. With RGB windows with no transparency, this is just the shape of the window, but with ARGB32 windows, the compositor does not know what regions of the window are transparent or not.

This function only works for toplevel windows.

GTK+ will update this property automatically if the self background is opaque, as we know where the opaque regions are. If your window background is not opaque, please update this property in your GtkWidget::style-updated handler.

§region

a region, or None

Source

pub fn set_override_redirect(&self, override_redirect: bool)

An override redirect window is not under the control of the window manager. This means it won’t have a titlebar, won’t be minimizable, etc. - it will be entirely under the control of the application. The window manager can’t see the override redirect window at all.

Override redirect should only be used for short-lived temporary windows, such as popup menus. GtkMenu uses an override redirect window in its implementation, for example.

§override_redirect

true if window should be override redirect

Source

pub fn set_pass_through(&self, pass_through: bool)

Sets whether input to the window is passed through to the window below.

The default value of this is false, which means that pointer events that happen inside the window are send first to the window, but if the event is not selected by the event mask then the event is sent to the parent window, and so on up the hierarchy.

If pass_through is true then such pointer events happen as if the window wasn’t there at all, and thus will be sent first to any windows below self. This is useful if the window is used in a transparent fashion. In the terminology of the web this would be called “pointer-events: none”.

Note that a window with pass_through true can still have a subwindow without pass through, so you can get events on a subset of a window. And in that cases you would get the in-between related events such as the pointer enter/leave events on its way to the destination window.

§pass_through

a boolean

Source

pub fn set_role(&self, role: &str)

When using GTK+, typically you should use gtk_window_set_role() instead of this low-level function.

The window manager and session manager use a window’s role to distinguish it from other kinds of window in the same application. When an application is restarted after being saved in a previous session, all windows with the same title and role are treated as interchangeable. So if you have two windows with the same title that should be distinguished for session management purposes, you should set the role on those windows. It doesn’t matter what string you use for the role, as long as you have a different role for each non-interchangeable kind of window.

§role

a string indicating its role

Source

pub fn set_shadow_width(&self, left: i32, right: i32, top: i32, bottom: i32)

Newer GTK+ windows using client-side decorations use extra geometry around their frames for effects like shadows and invisible borders. Window managers that want to maximize windows or snap to edges need to know where the extents of the actual frame lie, so that users don’t feel like windows are snapping against random invisible edges.

Note that this property is automatically updated by GTK+, so this function should only be used by applications which do not use GTK+ to create toplevel windows.

§left

The left extent

The right extent

§top

The top extent

§bottom

The bottom extent

Source

pub fn set_skip_pager_hint(&self, skips_pager: bool)

Toggles whether a window should appear in a pager (workspace switcher, or other desktop utility program that displays a small thumbnail representation of the windows on the desktop). If a window’s semantic type as specified with set_type_hint() already fully describes the window, this function should not be called in addition, instead you should allow the window to be treated according to standard policy for its semantic type.

§skips_pager

true to skip the pager

Source

pub fn set_skip_taskbar_hint(&self, skips_taskbar: bool)

Toggles whether a window should appear in a task list or window list. If a window’s semantic type as specified with set_type_hint() already fully describes the window, this function should not be called in addition, instead you should allow the window to be treated according to standard policy for its semantic type.

§skips_taskbar

true to skip the taskbar

Source

pub fn set_source_events(&self, source: InputSource, event_mask: EventMask)

Sets the event mask for any floating device (i.e. not attached to any visible pointer) that has the source defined as source. This event mask will be applied both to currently existing, newly added devices after this call, and devices being attached/detached.

§source

a InputSource to define the source class.

§event_mask

event mask for self

Source

pub fn set_startup_id(&self, startup_id: &str)

When using GTK+, typically you should use gtk_window_set_startup_id() instead of this low-level function.

§startup_id

a string with startup-notification identifier

Source

pub fn set_support_multidevice(&self, support_multidevice: bool)

This function will enable multidevice features in self.

Multidevice aware windows will need to handle properly multiple, per device enter/leave events, device grabs and grab ownerships.

§support_multidevice

true to enable multidevice support in self.

Source

pub fn set_title(&self, title: &str)

Sets the title of a toplevel window, to be displayed in the titlebar. If you haven’t explicitly set the icon name for the window (using set_icon_name()), the icon name will be set to title as well. title must be in UTF-8 encoding (as with all user-readable strings in GDK/GTK+). title may not be None.

§title

title of self

Source

pub fn set_transient_for(&self, parent: &Window)

Indicates to the window manager that self is a transient dialog associated with the application window parent. This allows the window manager to do things like center self on parent and keep self above parent.

See gtk_window_set_transient_for() if you’re using GtkWindow or GtkDialog.

§parent

another toplevel Window

Source

pub fn set_type_hint(&self, hint: WindowTypeHint)

The application can use this call to provide a hint to the window manager about the functionality of a window. The window manager can use this information when determining the decoration and behaviour of the window.

The hint must be set before the window is mapped.

§hint

A hint of the function this window will have

Source

pub fn set_urgency_hint(&self, urgent: bool)

Toggles whether a window needs the user’s urgent attention.

§urgent

true if the window is urgent

Source

pub fn shape_combine_region( &self, shape_region: Option<&Region>, offset_x: i32, offset_y: i32, )

Makes pixels in self outside shape_region be transparent, so that the window may be nonrectangular.

If shape_region is None, the shape will be unset, so the whole window will be opaque again. offset_x and offset_y are ignored if shape_region is None.

On the X11 platform, this uses an X server extension which is widely available on most common platforms, but not available on very old X servers, and occasionally the implementation will be buggy. On servers without the shape extension, this function will do nothing.

This function works on both toplevel and child windows.

§shape_region

region of window to be non-transparent

§offset_x

X position of shape_region in self coordinates

§offset_y

Y position of shape_region in self coordinates

Source

pub fn show(&self)

Like show_unraised(), but also raises the window to the top of the window stack (moves the window to the front of the Z-order).

This function maps a window so it’s visible onscreen. Its opposite is hide().

When implementing a GtkWidget, you should call this function on the widget’s Window as part of the “map” method.

Source

pub fn show_unraised(&self)

Shows a Window onscreen, but does not modify its stacking order. In contrast, show() will raise the window to the top of the window stack.

On the X11 platform, in Xlib terms, this function calls XMapWindow() (it also updates some internal GDK state, which means that you can’t really use XMapWindow() directly on a GDK window).

Source

pub fn show_window_menu(&self, event: &mut Event) -> bool

Asks the windowing system to show the window menu. The window menu is the menu shown when right-clicking the titlebar on traditional windows managed by the window manager. This is useful for windows using client-side decorations, activating it with a right-click on the window decorations.

§event

a GdkEvent to show the menu for

§Returns

true if the window menu was shown and false otherwise.

Source

pub fn stick(&self)

“Pins” a window such that it’s on all workspaces and does not scroll with viewports, for window managers that have scrollable viewports. (When using GtkWindow, gtk_window_stick() may be more useful.)

On the X11 platform, this function depends on window manager support, so may have no effect with many window managers. However, GDK will do the best it can to convince the window manager to stick the window. For window managers that don’t support this operation, there’s nothing you can do to force it to happen.

Source

pub fn thaw_updates(&self)

Thaws a window frozen with freeze_updates().

Source

pub fn unfullscreen(&self)

Moves the window out of fullscreen mode. If the window was not fullscreen, does nothing.

On X11, asks the window manager to move self out of the fullscreen state, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “fullscreen”; so you can’t rely on the unfullscreenification actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

Source

pub fn unmaximize(&self)

Unmaximizes the window. If the window wasn’t maximized, then this function does nothing.

On X11, asks the window manager to unmaximize self, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “maximized”; so you can’t rely on the unmaximization actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

On Windows, reliably unmaximizes the window.

Source

pub fn unstick(&self)

Reverse operation for stick(); see stick(), and gtk_window_unstick().

Source

pub fn withdraw(&self)

Withdraws a window (unmaps it and asks the window manager to forget about it). This function is not really useful as hide() automatically withdraws toplevel windows before hiding them.

Source

pub fn constrain_size( geometry: &mut Geometry, flags: WindowHints, width: i32, height: i32, ) -> (i32, i32)

Constrains a desired width and height according to a set of geometry hints (such as minimum and maximum size).

§geometry

a Geometry structure

§flags

a mask indicating what portions of geometry are set

§width

desired width of window

§height

desired height of the window

§Returns
§new_width

location to store resulting width

§new_height

location to store resulting height

Source

pub fn connect_create_surface<F: Fn(&Self, i32, i32) -> Surface + 'static>( &self, f: F, ) -> SignalHandlerId

The ::create-surface signal is emitted when an offscreen window needs its surface (re)created, which happens either when the window is first drawn to, or when the window is being resized. The first signal handler that returns a non-None surface will stop any further signal emission, and its surface will be used.

Note that it is not possible to access the window’s previous surface from within any callback of this signal. Calling gdk_offscreen_window_get_surface() will lead to a crash.

§width

the width of the offscreen surface to create

§height

the height of the offscreen surface to create

§Returns

the newly created cairo::Surface for the offscreen window

Source

pub fn connect_pick_embedded_child<F: Fn(&Self, f64, f64) -> Option<Window> + 'static>( &self, f: F, ) -> SignalHandlerId

The ::pick-embedded-child signal is emitted to find an embedded child at the given position.

§x

x coordinate in the window

§y

y coordinate in the window

§Returns

the Window of the embedded child at x, y, or None

Source

pub fn connect_cursor_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

impl Window

Source

pub fn new(parent: Option<&Window>, attributes: &WindowAttr) -> Window

Creates a new Window using the attributes from attributes. See GdkWindowAttr and GdkWindowAttributesType for more details. Note: to use this on displays other than the default display, parent must be specified.

§parent

a Window, or None to create the window as a child of the default root window for the default display.

§attributes

attributes of the new window

§attributes_mask

mask indicating which fields in attributes are valid

§Returns

the new Window

Source

pub fn create_similar_surface( &self, content: Content, width: i32, height: i32, ) -> Option<Surface>

Create a new surface that is as compatible as possible with the given self. For example the new surface will have the same fallback resolution and font options as self. Generally, the new surface will also use the same backend as self, unless that is not possible for some reason. The type of the returned surface may be examined with cairo_surface_get_type().

Initially the surface contents are all 0 (transparent if contents have transparency, black otherwise.)

§content

the content for the new surface

§width

width of the new surface

§height

height of the new surface

§Returns

a pointer to the newly allocated surface. The caller owns the surface and should call cairo_surface_destroy() when done with it.

This function always returns a valid pointer, but it will return a pointer to a “nil” surface if other is already in an error state or any other error occurs.

Source

pub fn create_similar_image_surface( &self, format: Format, width: i32, height: i32, scale: i32, ) -> Option<Surface>

Create a new image surface that is efficient to draw on the given self.

Initially the surface contents are all 0 (transparent if contents have transparency, black otherwise.)

The width and height of the new surface are not affected by the scaling factor of the self, or by the scale argument; they are the size of the surface in device pixels. If you wish to create an image surface capable of holding the contents of self you can use:

⚠️ The following code is in C ⚠️

  int scale = gdk_window_get_scale_factor (window);
  int width = gdk_window_get_width (window) * scale;
  int height = gdk_window_get_height (window) * scale;

  // format is set elsewhere
  cairo_surface_t *surface =
    gdk_window_create_similar_image_surface (window,
                                             format,
                                             width, height,
                                             scale);

Note that unlike cairo_surface_create_similar_image(), the new surface’s device scale is set to scale, or to the scale factor of self if scale is 0.

§format

the format for the new surface

§width

width of the new surface

§height

height of the new surface

§scale

the scale of the new surface, or 0 to use same as self

§Returns

a pointer to the newly allocated surface. The caller owns the surface and should call cairo_surface_destroy() when done with it.

This function always returns a valid pointer, but it will return a pointer to a “nil” surface if other is already in an error state or any other error occurs.

Trait Implementations§

Source§

impl Clone for Window

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Window

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Window

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Window

Source§

impl HasParamSpec for Window

Source§

type ParamSpec = ParamSpecObject

Source§

type SetValue = Window

Preferred value to be used as setter for the associated ParamSpec.
Source§

type BuilderFn = fn(&str) -> ParamSpecObjectBuilder<'_, Window>

Source§

fn param_spec_builder() -> Self::BuilderFn

Source§

impl Hash for Window

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Window

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl ParentClassIs for Window

Source§

impl<OT: ObjectType> PartialEq<OT> for Window

Source§

fn eq(&self, other: &OT) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<OT: ObjectType> PartialOrd<OT> for Window

Source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StaticType for Window

Source§

fn static_type() -> Type

Returns the type identifier of Self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Cast for T
where T: ObjectType,

Source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
Source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
Source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
Source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
Source§

fn dynamic_cast<T>(self) -> Result<T, Self>
where T: ObjectType,

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while upcast will do many checks at compile-time already. downcast will perform the same checks at runtime as dynamic_cast, but will also ensure some amount of compile-time safety. Read more
Source§

fn dynamic_cast_ref<T>(&self) -> Option<&T>
where T: ObjectType,

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
Source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
Source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

Source§

impl<U> IsSubclassableExt for U

Source§

impl<Super, Sub> MayDowncastTo<Sub> for Super
where Super: IsA<Super>, Sub: IsA<Super>,

Source§

impl<T> ObjectExt for T
where T: ObjectType,

Source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
Source§

fn type_(&self) -> Type

Returns the type of the object.
Source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
Source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
Source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
Source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
Source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
Source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
Source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
Source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
Source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
Source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
Source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
Source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
Source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
Source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
Source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
Source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
Source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
Source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
Source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
Source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
Source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
Source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
Source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
Source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
Source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
Source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
Source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
Source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
Source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
Source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
Source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures.
Source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R

Emit signal by signal id. Read more
Source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
Source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R

Emit signal by its name. Read more
Source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>

Emit signal by its name. Read more
Source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by its name with details. Read more
Source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by its name with details. Read more
Source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by signal id with details. Read more
Source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by signal id with details. Read more
Source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
Source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
Source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
Source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
Source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
Source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
Source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
Source§

fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + Send + 'static,

Add a callback to be notified when the Object is disposed.
Source§

fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + 'static,

Add a callback to be notified when the Object is disposed. Read more
Source§

fn bind_property<'a, 'f, 't, O>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str, ) -> BindingBuilder<'a, 'f, 't>
where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
Source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
Source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
Source§

impl<T> Property for T
where T: HasParamSpec,

Source§

type Value = T

Source§

impl<T> PropertyGet for T
where T: HasParamSpec,

Source§

type Value = T

Source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

Source§

impl<T> StaticTypeExt for T
where T: StaticType,

Source§

fn ensure_type()

Ensures that the type has been registered with the type system.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TransparentType for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<O> WindowExtManual for O
where O: IsA<Window>,