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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* 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,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -15,15 +15,28 @@
|
|||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
int main (string[] args) {
|
namespace Yggtk {
|
||||||
|
|
||||||
Gtk.init (ref args);
|
public class Application : Gtk.Application {
|
||||||
|
|
||||||
Yggtk.AppWindow window = new Yggtk.AppWindow ();
|
public Application () {
|
||||||
window.show_all ();
|
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 = [
|
yggtk_sources = [
|
||||||
'main.vala',
|
'application.vala',
|
||||||
'app-window.vala',
|
'app-window.vala',
|
||||||
'utils.vala',
|
'utils.vala',
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user