-
-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathmain.vala
More file actions
25 lines (21 loc) · 696 Bytes
/
main.vala
File metadata and controls
25 lines (21 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env -S vala workbench.vala workbench.Resource.c --gresources=workbench_demo.xml --pkg gtk4
// The resource will be provided by Workbench when the demo compiles, see shebang above.
[GtkTemplate (ui = "/re/sonny/Workbench/demo/workbench_template.ui")]
public class AwesomeButton : Gtk.Button {
[GtkCallback]
private void onclicked (Gtk.Button button) {
message ("Clicked");
}
}
public void main () {
var container = new Gtk.ScrolledWindow();
var flow_box = new Gtk.FlowBox() {
hexpand = true
};
container.set_child(flow_box);
for (var i = 0; i < 100; i++) {
var widget = new AwesomeButton();
flow_box.append(widget);
}
workbench.preview(container);
}