Setup a basic GTK app.
21min
This commit is contained in:
parent
e7eff31d3f
commit
08c0128f2f
@ -1,3 +1,10 @@
|
|||||||
project('write-as-gtk', ['vala', 'c'], meson_version: '>=0.40.1')
|
project('write-as-gtk', ['vala', 'c'], meson_version: '>=0.40.1')
|
||||||
|
|
||||||
|
i18n = import('i18n')
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
||||||
|
configure_file(output: 'config.h', configuration: conf)
|
||||||
|
config_h_dir = include_directories('.')
|
||||||
|
|
||||||
subdir('data')
|
subdir('data')
|
||||||
|
subdir('src')
|
||||||
|
17
src/application.vala
Normal file
17
src/application.vala
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
public class WriteAs.Application : Gtk.Application {
|
||||||
|
construct {
|
||||||
|
Intl.setlocale(LocaleCategory.ALL, "");
|
||||||
|
Intl.textdomain("write.as");
|
||||||
|
|
||||||
|
application_id = "write-as-gtk.desktop";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void activate() {
|
||||||
|
if (get_windows().length() == 0)
|
||||||
|
new Gtk.ApplicationWindow(this).show_all();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int main(string[] args) {
|
||||||
|
return new WriteAs.Application().run(args);
|
||||||
|
}
|
||||||
|
}
|
8
src/meson.build
Normal file
8
src/meson.build
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
executable('write-as-gtk',
|
||||||
|
'application.vala',
|
||||||
|
|
||||||
|
c_args: ['-include', 'config.h'],
|
||||||
|
link_args: '-lm',
|
||||||
|
dependencies: [dependency('gtk+-3.0')],
|
||||||
|
install: true
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user