forked from gerito1/vala-gtk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid.vala
39 lines (31 loc) · 912 Bytes
/
grid.vala
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* The Grid allows widgets to be placed horizontally and vertically across one
* or more cells with options provided for spacing and sizing.
*/
using Gtk;
public class Example : Window
{
public Example()
{
this.title = "Grid";
this.destroy.connect(Gtk.main_quit);
var grid = new Grid();
grid.set_row_spacing(5);
grid.set_column_spacing(5);
this.add(grid);
var button1 = new Button.with_label("Button 1");
grid.attach(button1, 0, 0, 1, 1);
var button2 = new Button.with_label("Button 2");
grid.attach(button2, 1, 0, 1, 2);
var button3 = new Button.with_label("Button 3");
grid.attach(button3, 0, 1, 1, 1);
}
public static int main(string[] args)
{
Gtk.init(ref args);
var window = new Example();
window.show_all();
Gtk.main();
return 0;
}
}