add app groups
This commit is contained in:
parent
0bca6c94b6
commit
b1cff2ab59
11 changed files with 373 additions and 76 deletions
34
examples/app_library/grid_item/imp.rs
Normal file
34
examples/app_library/grid_item/imp.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
use gtk::glib;
|
||||
use gtk::prelude::*;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::CompositeTemplate;
|
||||
|
||||
#[derive(Debug, Default, CompositeTemplate)]
|
||||
#[template(file = "grid_item.ui")]
|
||||
pub struct GridItem {
|
||||
#[template_child]
|
||||
pub name: TemplateChild<gtk::Label>,
|
||||
#[template_child]
|
||||
pub image: TemplateChild<gtk::Image>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for GridItem {
|
||||
const NAME: &'static str = "GridItem";
|
||||
type Type = super::GridItem;
|
||||
type ParentType = gtk::Box;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
||||
Self::bind_template(klass);
|
||||
}
|
||||
|
||||
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
|
||||
obj.init_template();
|
||||
}
|
||||
}
|
||||
|
||||
impl ObjectImpl for GridItem {}
|
||||
impl WidgetImpl for GridItem {}
|
||||
impl BoxImpl for GridItem {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue