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

Commit

Permalink
subclass: Add support for subclassing gtk::EventBox
Browse files Browse the repository at this point in the history
Like bin this is an empty trait & `override_vfuncs()`.
  • Loading branch information
BrainBlasted committed Aug 11, 2019
1 parent 5384e32 commit 03e8c46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/subclass/event_box.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use glib::subclass::prelude::*;

use super::bin::BinImpl;
use EventBoxClass;

pub trait EventBoxImpl: BinImpl + 'static {}

unsafe impl<T: ObjectSubclass + EventBoxImpl> IsSubclassable<T> for EventBoxClass {
fn override_vfuncs(&mut self) {
}
}
2 changes: 2 additions & 0 deletions src/subclass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
pub mod application;
pub mod bin;
pub mod container;
pub mod event_box;
pub mod widget;

pub mod prelude {
pub use super::application::GtkApplicationImpl;
pub use super::bin::BinImpl;
pub use super::event_box::EventBoxImpl;
pub use super::widget::WidgetImpl;
pub use gio::subclass::prelude::*;
pub use glib::subclass::prelude::*;
Expand Down

0 comments on commit 03e8c46

Please sign in to comment.