Created
March 1, 2011 18:06
-
-
Save dimitrov/849564 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile using valac app.vala -o app --pkg gtk+-2.0 | |
using Gtk; | |
namespace MyApp | |
{ | |
class MyApp: Gtk.Window | |
{ | |
public MyApp() | |
{ | |
this.set_default_size(100, 100); | |
var button = new Button.with_label("Click me!"); | |
add(button); | |
button.clicked.connect(this.on_button_clicked); | |
} | |
private void on_button_clicked(Button button) | |
{ | |
stdout.printf("Button clicked!\n"); | |
} | |
public static int main(string[] args) | |
{ | |
Gtk.init(ref args); | |
var app = new MyApp(); | |
app.show_all(); | |
app.destroy.connect(Gtk.main_quit); | |
Gtk.main(); | |
return 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment