mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
connect events
This commit is contained in:
parent
ac5a878fdf
commit
4877e24020
@ -5,19 +5,11 @@ pub struct Tab {
|
||||
}
|
||||
|
||||
impl Tab {
|
||||
// Construct
|
||||
pub fn new() -> Tab {
|
||||
// Init widget
|
||||
let 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 }
|
||||
Self {
|
||||
widget: widget::Tab::new(),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
@ -1,3 +1,5 @@
|
||||
use gtk::prelude::{ButtonExt, WidgetExt};
|
||||
|
||||
pub struct Tab {
|
||||
gtk: gtk::Button,
|
||||
}
|
||||
@ -5,11 +7,18 @@ pub struct Tab {
|
||||
impl Tab {
|
||||
// Construct
|
||||
pub fn new() -> Tab {
|
||||
// Init widget
|
||||
let gtk = gtk::Button::builder()
|
||||
.icon_name("tab-new-symbolic")
|
||||
.tooltip_text("New tab")
|
||||
.build();
|
||||
|
||||
// Init events
|
||||
gtk.connect_clicked(|this| {
|
||||
this.activate_action("win.tab_append", None)
|
||||
.expect("The action does not exist");
|
||||
});
|
||||
|
||||
Self { gtk }
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user