Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //valac -o demo-appwin --pkg gtk+-3.0 demo_appwin.vala
- using Gtk;
- public class DemoApp: Gtk.Application
- {
- private Builder builder;
- private Window main_window;
- public DemoApp() {
- Object(application_id: "com.susilolabs.demoapp", flags: ApplicationFlags.FLAGS_NONE);
- }
- protected override void activate() {
- try {
- builder = new Builder();
- builder.add_from_file("demo_appwin.glade");
- this.main_window = builder.get_object("appwin") as Window;
- this.main_window.application = this;
- this.main_window.show_all();
- }catch(Error e) {
- stderr.printf("%s\n", e.message);
- }
- }
- public static int main(string[] args) {
- DemoApp app = new DemoApp();
- return app.run(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement