Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

add basic subclassing functionality for treeview #975

Merged
merged 1 commit into from
Mar 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/subclass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub mod fixed;
pub mod header_bar;
pub mod icon_view;
pub mod stack;
pub mod tree_view;
pub mod widget;
pub mod window;

Expand All @@ -48,6 +49,7 @@ pub mod prelude {
pub use super::header_bar::HeaderBarImpl;
pub use super::icon_view::{IconViewImpl, IconViewImplExt};
pub use super::stack::StackImpl;
pub use super::tree_view::TreeViewImpl;
pub use super::widget::{WidgetImpl, WidgetImplExt};
pub use super::window::{WindowImpl, WindowImplExt};
pub use gio::subclass::prelude::*;
Expand Down
13 changes: 13 additions & 0 deletions src/subclass/tree_view.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use glib::subclass::prelude::*;

use super::container::ContainerImpl;
use ContainerClass;
use TreeViewClass;

pub trait TreeViewImpl: ContainerImpl + 'static {}

unsafe impl<T: ObjectSubclass + ContainerImpl> IsSubclassable<T> for TreeViewClass {
fn override_vfuncs(&mut self) {
<ContainerClass as IsSubclassable<T>>::override_vfuncs(self);
}
}