File: paned.vala

package info (click to toggle)
gnome-devel-docs 3.14.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 46,300 kB
  • ctags: 630
  • sloc: xml: 2,321; ansic: 2,040; python: 1,807; makefile: 747; sh: 504; cpp: 131
file content (35 lines) | stat: -rw-r--r-- 958 bytes parent folder | download | duplicates (5)
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
/* This is the application. */
public class MyApplication : Gtk.Application {
	/* Override the 'activate' signal of GLib.Application. */
	protected override void activate () {

		var window = new Gtk.ApplicationWindow (this);
		window.title = "Paned Example";
		window.set_default_size (450,350);

		// a new widget with two adjustable panes,
		// one on the left and one on the right
		var paned = new Gtk.Paned (Gtk.Orientation.HORIZONTAL);

		/* two images */
		var image1 = new Gtk.Image ();
		image1.set_from_file ("gnome-image.png");
		var image2 = new Gtk.Image ();
		image2.set_from_file ("tux.png");

		/* add the first image to the left pane */
		paned.add1 (image1);

		/* add the second image to the right pane */
		paned.add2 (image2);

		/* add the panes to the window */
		window.add (paned);
		window.show_all ();
	}
}

/* main creates and runs the application. */
public int main (string[] args) {
	return new MyApplication ().run (args);
}