dev/vala/4JavaProgrammers/vala-for-scripting.sh

26 lines
569 B
Bash
Executable File

#!/usr/bin/env vala --pkg gtk+-3.0
using Gtk;
public static int main (string[] args) {
Gtk.init (ref args);
Window window = new Window(WindowType.TOPLEVEL);
window.set_size_request(100, 100);
window.destroy.connect(main_quit);
Button button = new Button.with_label("Push me");
button.clicked.connect(() => {
MessageDialog msg = new MessageDialog(window, DialogFlags.MODAL,
MessageType.INFO, ButtonsType.OK, "Some message");
msg.run();
msg.close();
});
window.add(button);
window.show_all();
Gtk.main();
return 0;
}