summaryrefslogtreecommitdiff
path: root/examples/gtk3/vala/simple-bar/app.in.vala
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gtk3/vala/simple-bar/app.in.vala')
-rw-r--r--examples/gtk3/vala/simple-bar/app.in.vala30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/gtk3/vala/simple-bar/app.in.vala b/examples/gtk3/vala/simple-bar/app.in.vala
new file mode 100644
index 0000000..b04a1fa
--- /dev/null
+++ b/examples/gtk3/vala/simple-bar/app.in.vala
@@ -0,0 +1,30 @@
+class App : Astal.Application {
+ public static App instance;
+
+ public override void request (string msg, SocketConnection conn) {
+ print(@"$msg\n");
+ AstalIO.write_sock.begin(conn, "ok");
+ }
+
+ public override void activate () {
+ foreach (var mon in this.monitors)
+ add_window(new Bar(mon));
+
+ apply_css("@STYLE@");
+ }
+
+ public static void main(string[] args) {
+ var instance_name = "vala";
+
+ App.instance = new App() {
+ instance_name = instance_name
+ };
+
+ try {
+ App.instance.acquire_socket();
+ App.instance.run(null);
+ } catch (Error err) {
+ print(AstalIO.send_message(instance_name, string.joinv(" ", args)));
+ }
+ }
+}