mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
connect events
This commit is contained in:
parent
ac5a878fdf
commit
4877e24020
2 changed files with 13 additions and 12 deletions
|
|
@ -5,19 +5,11 @@ pub struct Tab {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tab {
|
impl Tab {
|
||||||
|
// Construct
|
||||||
pub fn new() -> Tab {
|
pub fn new() -> Tab {
|
||||||
// Init widget
|
Self {
|
||||||
let widget = widget::Tab::new();
|
widget: widget::Tab::new(),
|
||||||
|
}
|
||||||
// Init events
|
|
||||||
/* @TODO
|
|
||||||
widget.connect_clicked(|this| {
|
|
||||||
this.activate_action("win.tab_append", None)
|
|
||||||
.expect("The action does not exist");
|
|
||||||
}); */
|
|
||||||
|
|
||||||
// Result
|
|
||||||
Self { widget }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
use gtk::prelude::{ButtonExt, WidgetExt};
|
||||||
|
|
||||||
pub struct Tab {
|
pub struct Tab {
|
||||||
gtk: gtk::Button,
|
gtk: gtk::Button,
|
||||||
}
|
}
|
||||||
|
|
@ -5,11 +7,18 @@ pub struct Tab {
|
||||||
impl Tab {
|
impl Tab {
|
||||||
// Construct
|
// Construct
|
||||||
pub fn new() -> Tab {
|
pub fn new() -> Tab {
|
||||||
|
// Init widget
|
||||||
let gtk = gtk::Button::builder()
|
let gtk = gtk::Button::builder()
|
||||||
.icon_name("tab-new-symbolic")
|
.icon_name("tab-new-symbolic")
|
||||||
.tooltip_text("New tab")
|
.tooltip_text("New tab")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
// Init events
|
||||||
|
gtk.connect_clicked(|this| {
|
||||||
|
this.activate_action("win.tab_append", None)
|
||||||
|
.expect("The action does not exist");
|
||||||
|
});
|
||||||
|
|
||||||
Self { gtk }
|
Self { gtk }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue