1/* This is the application. */ 2public class MyApplication : Gtk.Application { 3 /* Override the 'activate' signal of GLib.Application. */ 4 protected override void activate () { 5 /* Create the window of this application. */ 6 var window = new Gtk.ApplicationWindow (this); 7 window.title = "ScrolledWindow Example"; 8 window.set_default_size (200, 200); 9 10 var scrolled_window = new Gtk.ScrolledWindow (null, null); 11 scrolled_window.set_border_width (10); 12 scrolled_window.add_with_viewport (new Gtk.Image.from_file ("gnome-image.png")); 13 scrolled_window.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC); 14 15 window.add (scrolled_window); 16 window.show_all (); 17 } 18} 19 20/* main creates and runs the application. */ 21public int main (string[] args) { 22 return new MyApplication ().run (args); 23} 24