[gtk-web/new-website: 122/180] added new doc files



commit 87e301f896d4cb03e3f2883635ba4fd3dadbd9d5
Author: ravgeetdhillon <ravgeetdhillon gmail com>
Date:   Sun Jul 28 17:32:44 2019 +0530

    added new doc files

 _data/navigation.yml            | 15 ++++++++++++++-
 collections/_docs/c.md          | 32 ++++++++++++++++++++++++++++++++
 collections/_docs/javascript.md | 28 ++++++++++++++++++++++++++++
 collections/_docs/python.md     | 27 +++++++++++++++++++++++++++
 collections/_docs/vala.md       | 21 +++++++++++++++++++++
 5 files changed, 122 insertions(+), 1 deletion(-)
---
diff --git a/_data/navigation.yml b/_data/navigation.yml
index bf54040..46b005f 100644
--- a/_data/navigation.yml
+++ b/_data/navigation.yml
@@ -102,6 +102,7 @@ menu_links:
     header: false
     footer: true
     section: Company
+    external: true
   - name: Consultation
     href: /support#consultation
     header: false
@@ -195,4 +196,16 @@ sidebar_links:
     section: Architecture
   - title: Hello World
     name: hello-world
-    section: Getting Started
\ No newline at end of file
+    section: Getting Started
+  - title: Python
+    name: python
+    section: Language Bindings
+  - title: C
+    name: c
+    section: Language Bindings
+  - title: Javascript
+    name: javascript
+    section: Language Bindings
+  - title: Vala
+    name: vala
+    section: Language Bindings
\ No newline at end of file
diff --git a/collections/_docs/c.md b/collections/_docs/c.md
new file mode 100644
index 0000000..4e5c809
--- /dev/null
+++ b/collections/_docs/c.md
@@ -0,0 +1,32 @@
+---
+permalink: /docs/language-bindings/:name/
+---
+# C and GTK
+
+```c
+#include <gtk/gtk.h>
+
+static void
+activate (GApplication *app,
+          gpointer      user_data)
+{
+  GtkWidget *widget;
+
+  widget = gtk_application_window_new (GTK_APPLICATION (app));
+  gtk_widget_show (widget);
+}
+
+int
+main (int argc, char **argv)
+{
+  GtkApplication *app;
+  int status;
+
+  app = gtk_application_new ("org.gnome.example", G_APPLICATION_FLAGS_NONE);
+  g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
+  status = g_application_run (G_APPLICATION (app), argc, argv);
+  g_object_unref (app);
+
+  return status;
+}
+```
\ No newline at end of file
diff --git a/collections/_docs/javascript.md b/collections/_docs/javascript.md
new file mode 100644
index 0000000..224355a
--- /dev/null
+++ b/collections/_docs/javascript.md
@@ -0,0 +1,28 @@
+---
+permalink: /docs/language-bindings/:name/
+---
+# GTK and Javascript
+
+```javascript
+const Gio = imports.gi.Gio;
+const Gtk = imports.gi.Gtk;
+const Lang = imports.lang;
+
+const ExampleApp = Lang.Class({
+    Name: 'ExampleApp',
+    Extends: Gtk.Application,
+
+    _init: function() {
+        this.parent({ application_id: 'org.gnome.example',
+                      flags: Gio.ApplicationFlags.FLAGS_NONE, });
+    },
+
+    vfunc_activate: function() {
+        let w = new Gtk.ApplicationWindow({ application: this });
+        w.show();
+    },
+});
+
+let app = new ExampleApp();
+app.run(ARGV);
+```
\ No newline at end of file
diff --git a/collections/_docs/python.md b/collections/_docs/python.md
new file mode 100644
index 0000000..e267b04
--- /dev/null
+++ b/collections/_docs/python.md
@@ -0,0 +1,27 @@
+---
+permalink: /docs/language-bindings/:name/
+---
+#  GTK and Python
+
+```python
+import sys
+import gi
+
+gi.require_version('Gtk', '3.0')
+from gi.repository import Gio
+from gi.repository import Gtk
+
+class App(Gtk.Application):
+    def __init__(self):
+        Gtk.Application.__init__(self,
+                                 application_id="org.gnome.example",
+                                 flags=Gio.ApplicationFlags.FLAGS_NONE)
+
+    def do_activate(self):
+        window = Gtk.ApplicationWindow(application=self)
+        window.show()
+
+if __name__ == '__main__':
+    app = App()
+    app.run(sys.argv)
+```
\ No newline at end of file
diff --git a/collections/_docs/vala.md b/collections/_docs/vala.md
new file mode 100644
index 0000000..beb9208
--- /dev/null
+++ b/collections/_docs/vala.md
@@ -0,0 +1,21 @@
+---
+permalink: /docs/language-bindings/:name/
+---
+# GTK and Vala
+
+```vala
+class ExampleApp : Gtk.Application {
+  protected override void activate () {
+    var window = new Gtk.ApplicationWindow (this);
+    window.show ();
+  }
+
+  public ExampleApp () {
+    Object (application_id: "org.gnome.example");
+  }
+}
+
+int main (string[] args) {
+  return new ExampleApp ().run (args);
+}
+```
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]