using Gtk; public class Example : Window { ScrolledWindow scroll = new ScrolledWindow(); Label label = new Label("This is a long text that needs to be scrolled to see its full content"); public Example() : base("ScrolledWindow Example") { SetDefaultSize(400, 300); scroll.Add(label); ContentArea.Add(scroll); scroll.ShowAll(); } public static void Main() { Application.Init(); new Example(); Application.Run(); } }
using Gtk; public class Example : Window { ScrolledWindow scroll = new ScrolledWindow(); TreeView tree = new TreeView(); ListStore store = new ListStore(typeof(string)); public Example() : base("ScrolledWindow Example") { SetDefaultSize(400, 300); tree.Model = store; scroll.Add(tree); ContentArea.Add(scroll); scroll.ShowAll(); } public static void Main() { Application.Init(); new Example(); Application.Run(); } }This example adds a `TreeView` widget to the ScrolledWindow container. The `ShowAll()` method is called to ensure that all columns of the tree view are visible and can be scrolled to see all rows of the list store. Package library for Gtk# in C# is `gtk-sharp`.