summaryrefslogtreecommitdiffstats
path: root/src/tabview.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tabview.rs')
-rw-r--r--src/tabview.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tabview.rs b/src/tabview.rs
index 8b87552..6afa10d 100644
--- a/src/tabview.rs
+++ b/src/tabview.rs
@@ -27,7 +27,7 @@ pub trait Tabbable {
}
fn on_refresh(&mut self) -> HResult<()> { Ok(()) }
fn on_config_loaded(&mut self) -> HResult<()> { Ok(()) }
-
+ fn on_new(&mut self) -> HResult<()> { Ok(()) }
}
@@ -41,11 +41,15 @@ pub struct TabView<T> where T: Widget, TabView<T>: Tabbable {
impl<T> TabView<T> where T: Widget, TabView<T>: Tabbable {
pub fn new(core: &WidgetCore) -> TabView<T> {
- TabView {
+ let mut tabview = TabView {
widgets: vec![],
active: 0,
core: core.clone()
- }
+ };
+
+ Tabbable::on_new(&mut tabview).log();
+
+ tabview
}
pub fn push_widget(&mut self, widget: T) -> HResult<()> {