Blame platform-demos/C/samples/image.vala
|
Packit |
1470ea |
public class MyWindow : Gtk.ApplicationWindow {
|
|
Packit |
1470ea |
internal MyWindow (MyApplication app) {
|
|
Packit |
1470ea |
Object (application: app, title: "Welcome to GNOME");
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
var image = new Gtk.Image ();
|
|
Packit |
1470ea |
image.set_from_file ("gnome-image.png");
|
|
Packit |
1470ea |
this.add (image);
|
|
Packit |
1470ea |
this.set_default_size (300, 300);
|
|
Packit |
1470ea |
}
|
|
Packit |
1470ea |
}
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
public class MyApplication : Gtk.Application {
|
|
Packit |
1470ea |
protected override void activate () {
|
|
Packit |
1470ea |
new MyWindow (this).show_all ();
|
|
Packit |
1470ea |
}
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
internal MyApplication () {
|
|
Packit |
1470ea |
Object (application_id: "org.example.MyApplication");
|
|
Packit |
1470ea |
}
|
|
Packit |
1470ea |
}
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
public int main (string[] args) {
|
|
Packit |
1470ea |
return new MyApplication ().run (args);
|
|
Packit |
1470ea |
}
|