add Application class
This commit is contained in:
parent
a682844ba1
commit
78a8be9299
@ -1,8 +1,8 @@
|
||||
/*
|
||||
/**
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -15,15 +15,28 @@
|
||||
|
||||
using Gtk;
|
||||
|
||||
int main (string[] args) {
|
||||
namespace Yggtk {
|
||||
|
||||
Gtk.init (ref args);
|
||||
public class Application : Gtk.Application {
|
||||
|
||||
Yggtk.AppWindow window = new Yggtk.AppWindow ();
|
||||
window.show_all ();
|
||||
public Application () {
|
||||
Object (
|
||||
application_id: "org.yggtk.yggtk",
|
||||
flags: ApplicationFlags.FLAGS_NONE
|
||||
);
|
||||
}
|
||||
|
||||
Gtk.main ();
|
||||
protected override void activate () {
|
||||
AppWindow window = new AppWindow ();
|
||||
add_window (window);
|
||||
window.show ();
|
||||
}
|
||||
|
||||
return 0;
|
||||
public static int main (string[] args) {
|
||||
Application app = new Application ();
|
||||
return app.run (args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
yggtk_sources = [
|
||||
'main.vala',
|
||||
'application.vala',
|
||||
'app-window.vala',
|
||||
'utils.vala',
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user