pub unsafe trait WidgetClassSubclassExt: ClassStruct<Type: WidgetImpl> {
// Provided methods
fn set_accessible_type(&mut self, type_: Type) { ... }
fn set_accessible_role(&mut self, role: Role) { ... }
fn set_template_bytes(&mut self, template: &Bytes) { ... }
fn enable_baseline_support(&mut self) { ... }
fn set_template(&mut self, template: &[u8]) { ... }
fn set_template_static(&mut self, template: &'static [u8]) { ... }
fn set_template_from_resource(&mut self, resource_name: &str) { ... }
fn bind_template_child(&mut self, name: &str) { ... }
unsafe fn bind_template_child_with_offset<T>(
&mut self,
name: &str,
offset: FieldOffset<Self::Type, TemplateChild<T>>,
)
where T: ObjectType + FromGlibPtrNone<*mut <T as ObjectType>::GlibType> { ... }
fn set_css_name(&mut self, name: &str) { ... }
fn css_name(&self) -> GString { ... }
}Provided Methods§
fn set_accessible_type(&mut self, type_: Type)
fn set_accessible_role(&mut self, role: Role)
fn set_template_bytes(&mut self, template: &Bytes)
Sourcefn enable_baseline_support(&mut self)
fn enable_baseline_support(&mut self)
Enables baseline support for this widget class.
You call this for two reasons:
- You want your widget subclass to implement baseline support, in which case you must
implement
WidgetImpl::preferred_height_and_baseline_for_width. You should not implementWidgetImpl::preferred_heightorWidgetImpl::preferred_height_for_width, as they will never be called. - You are subclassing a widget that implements baselines, and you want the parent’s baselines to continue working. In that case you should call this function (as the baseline-enabled state is not inherited), but do not implement the height/height-for-width trait items yourself.
If you want to control sizing yourself, without baseline support, do not call this, and
just implement WidgetImpl::preferred_height and
WidgetImpl::preferred_height_for_width.
fn set_template(&mut self, template: &[u8])
fn set_template_static(&mut self, template: &'static [u8])
fn set_template_from_resource(&mut self, resource_name: &str)
fn bind_template_child(&mut self, name: &str)
unsafe fn bind_template_child_with_offset<T>( &mut self, name: &str, offset: FieldOffset<Self::Type, TemplateChild<T>>, )
fn set_css_name(&mut self, name: &str)
fn css_name(&self) -> GString
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".