Skip to content

Instantly share code, notes, and snippets.

@tyhdefu
Last active November 9, 2022 12:08
Show Gist options
  • Save tyhdefu/e2503d0194b06223d9fdfc5d6191b187 to your computer and use it in GitHub Desktop.
Save tyhdefu/e2503d0194b06223d9fdfc5d6191b187 to your computer and use it in GitHub Desktop.
error[E0277]: the trait bound `gtk4::ListBox: IsSubclassable<job_list::imp::JobList>` is not satisfied
--> src\job_list\imp.rs:11:23
|
11 | type ParentType = gtk::ListBox;
| ^^^^^^^^^^^^ the trait `IsSubclassable<job_list::imp::JobList>` is not implemented for `gtk4::ListBox`
|
= help: the following other types implement trait `IsSubclassable<T>`:
Adjustment
ApplicationWindow
CellArea
CellAreaContext
CellRenderer
CellRendererText
CheckButton
ContentProvider
and 41 others
note: required by a bound in `gtk4::subclass::prelude::ObjectSubclass::ParentType`
--> C:\Users\james\.cargo\registry\src\github.com-1ecc6299db9ec823\glib-0.16.2\src\subclass\types.rs:553:22
|
553 | type ParentType: IsSubclassable<Self>
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `gtk4::subclass::prelude::ObjectSubclass::ParentType`
use gtk::glib;
use gtk::subclass::prelude::*;
#[derive(Default)]
pub struct JobList;
#[glib::object_subclass]
impl ObjectSubclass for JobList {
const NAME: &'static str = "RnotifydMainPaned";
type Type = super::JobList;
type ParentType = gtk::ListBox;
}
// Trait shared by all GObjects
impl ObjectImpl for JobList {}
// Trait shared by all widgets
impl WidgetImpl for JobList {}
// Trait shared by all buttons
impl ButtonImpl for JobList {}
mod imp;
use glib::Object;
use gtk::glib;
glib::wrapper! {
pub struct JobList(ObjectSubclass<imp::JobList>)
@extends gtk::ListBox, gtk::Widget,
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment