Skip to main content

RawWindow

Struct RawWindow 

Source
pub struct RawWindow<'a> {
    pub gtk_window: *mut c_void,
    pub default_vbox: Option<*mut c_void>,
    pub _marker: &'a PhantomData<()>,
}
Expand description

A raw window type that contains fields to access the HWND on Windows, GTK object pointers on Linux

§Ownership

Unlike the WindowDispatch getters, the GTK pointers here are transfer none: they are borrowed from the window that is being created and are only valid for the duration of the callback that receives this struct. Wrap them with glib’s from_glib_none (which takes its own reference) and do not store them - the 'a lifetime is not enforced by the raw pointers, so retaining one past the callback dereferences freed memory.

The GTK major version of the objects is the one the runtime was built against, so consumers must wrap them with matching bindings.

Fields§

§gtk_window: *mut c_void
Available on DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD only.

A borrowed GtkApplicationWindow*. Never null.

§default_vbox: Option<*mut c_void>
Available on DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD only.

A borrowed GtkBox*, or None when the runtime does not add a default vertical box. When set, it is never null.

§_marker: &'a PhantomData<()>

Ties this struct to the lifetime of the window the pointers above are borrowed from.

Auto Trait Implementations§

§

impl<'a> !Send for RawWindow<'a>

§

impl<'a> !Sync for RawWindow<'a>

§

impl<'a> Freeze for RawWindow<'a>

§

impl<'a> RefUnwindSafe for RawWindow<'a>

§

impl<'a> Unpin for RawWindow<'a>

§

impl<'a> UnsafeUnpin for RawWindow<'a>

§

impl<'a> UnwindSafe for RawWindow<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
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.