try this
This commit is contained in:
parent
48a5beb8b6
commit
f0f69b7323
1 changed files with 11 additions and 7 deletions
|
@ -17,15 +17,19 @@ mod imp {
|
||||||
impl ObjectImpl for Application {}
|
impl ObjectImpl for Application {}
|
||||||
|
|
||||||
impl ApplicationImpl for Application {
|
impl ApplicationImpl for Application {
|
||||||
|
// called once by the primary instance
|
||||||
|
fn startup(&self) {
|
||||||
|
self.parent_startup();
|
||||||
|
ui::Window::new(self.obj().as_ref());
|
||||||
|
}
|
||||||
|
|
||||||
|
// executed by the primary instance
|
||||||
fn activate(&self) {
|
fn activate(&self) {
|
||||||
self.parent_activate();
|
self.parent_activate();
|
||||||
match self.obj().active_window() {
|
self.obj()
|
||||||
None => {
|
.active_window()
|
||||||
let window = ui::Window::new(self.obj().as_ref());
|
.expect("no window was active")
|
||||||
window.present();
|
.present();
|
||||||
}
|
|
||||||
Some(win) => win.present(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue