pub trait DrawingAreaExt: IsA<DrawingArea> + 'static {
// Provided methods
fn content_height(&self) -> i32 { ... }
fn content_width(&self) -> i32 { ... }
fn set_content_height(&self, height: i32) { ... }
fn set_content_width(&self, width: i32) { ... }
fn connect_resize<F: Fn(&Self, i32, i32) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_content_height_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_content_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
Sourcefn content_height(&self) -> i32
fn content_height(&self) -> i32
Retrieves the content height of the DrawingArea
.
§Returns
The height requested for content of the drawing area
Sourcefn content_width(&self) -> i32
fn content_width(&self) -> i32
Retrieves the content width of the DrawingArea
.
§Returns
The width requested for content of the drawing area
Sourcefn set_content_height(&self, height: i32)
fn set_content_height(&self, height: i32)
Sets the desired height of the contents of the drawing area.
Note that because widgets may be allocated larger sizes than they
requested, it is possible that the actual height passed to your draw
function is larger than the height set here. You can use
WidgetExt::set_valign()
to avoid that.
If the height is set to 0 (the default), the drawing area may disappear.
§height
the height of contents
Sourcefn set_content_width(&self, width: i32)
fn set_content_width(&self, width: i32)
Sets the desired width of the contents of the drawing area.
Note that because widgets may be allocated larger sizes than they
requested, it is possible that the actual width passed to your draw
function is larger than the width set here. You can use
WidgetExt::set_halign()
to avoid that.
If the width is set to 0 (the default), the drawing area may disappear.
§width
the width of contents
Sourcefn connect_resize<F: Fn(&Self, i32, i32) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_resize<F: Fn(&Self, i32, i32) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_content_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_content_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.