|
Packit |
1470ea |
|
|
Packit |
1470ea |
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" xmlns:xi="http://www.w3.org/2001/XInclude" type="guide" style="task" id="scrolledwindow.vala" xml:lang="pt-BR">
|
|
Packit |
1470ea |
<info>
|
|
Packit |
1470ea |
<title type="text">ScrolledWindow (Vala)</title>
|
|
Packit |
1470ea |
<link type="guide" xref="beginner.vala#scrolling"/>
|
|
Packit |
1470ea |
<link type="seealso" xref="image.vala"/>
|
|
Packit |
1470ea |
<revision version="0.1" date="2012-06-08" status="draft"/>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<credit type="author copyright">
|
|
Packit |
1470ea |
<name>Tiffany Antopolski</name>
|
|
Packit |
1470ea |
<email its:translate="no">tiffany.antopolski@gmail.com</email>
|
|
Packit |
1470ea |
<years>2012</years>
|
|
Packit |
1470ea |
</credit>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<desc>Adds scrollbars to its child widget</desc>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
|
|
Packit |
1470ea |
<mal:name>Rafael Ferreira</mal:name>
|
|
Packit |
1470ea |
<mal:email>rafael.f.f1@gmail.com</mal:email>
|
|
Packit |
1470ea |
<mal:years>2013</mal:years>
|
|
Packit |
1470ea |
</mal:credit>
|
|
Packit |
1470ea |
</info>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<title>ScrolledWindow</title>
|
|
Packit |
1470ea |
<media type="image" mime="image/png" src="media/scrolledwindow.png"/>
|
|
Packit |
1470ea |
An image in a scrolled window.
|
|
Packit |
1470ea |
|
|
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 |
}
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
In this sample we used the following:
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<list>
|
|
Packit |
1470ea |
<item><link href="http://www.valadoc.org/gtk+-3.0/Gtk.ScrolledWindow.html">Gtk.ScrolledWindow</link> </item>
|
|
Packit |
1470ea |
<item><link href="http://www.valadoc.org/gtk+-3.0/Gtk.PolicyType.html">Gtk.PolicyType</link> </item>
|
|
Packit |
1470ea |
</list>
|
|
Packit |
1470ea |
</page>
|