Blame platform-demos/C/samples/scrolledwindow.vala
|
Packit |
1470ea |
/* This is the application. */
|
|
Packit |
1470ea |
public class MyApplication : Gtk.Application {
|
|
Packit |
1470ea |
/* Override the 'activate' signal of GLib.Application. */
|
|
Packit |
1470ea |
protected override void activate () {
|
|
Packit |
1470ea |
/* Create the window of this application. */
|
|
Packit |
1470ea |
var window = new Gtk.ApplicationWindow (this);
|
|
Packit |
1470ea |
window.title = "ScrolledWindow Example";
|
|
Packit |
1470ea |
window.set_default_size (200, 200);
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
var scrolled_window = new Gtk.ScrolledWindow (null, null);
|
|
Packit |
1470ea |
scrolled_window.set_border_width (10);
|
|
Packit |
1470ea |
scrolled_window.add_with_viewport (new Gtk.Image.from_file ("gnome-image.png"));
|
|
Packit |
1470ea |
scrolled_window.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
window.add (scrolled_window);
|
|
Packit |
1470ea |
window.show_all ();
|
|
Packit |
1470ea |
}
|
|
Packit |
1470ea |
}
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
/* main creates and runs the application. */
|
|
Packit |
1470ea |
public int main (string[] args) {
|
|
Packit |
1470ea |
return new MyApplication ().run (args);
|
|
Packit |
1470ea |
}
|