[gtk-web/new-website: 176/191] added documentation pages for rust and c++
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-web/new-website: 176/191] added documentation pages for rust and c++
- Date: Thu, 21 Nov 2019 12:33:17 +0000 (UTC)
commit 2989bd251b299b41af36317b56226f7be1670b5e
Author: ravgeetdhillon <ravgeetdhillon gmail com>
Date: Sat Aug 24 20:06:40 2019 +0530
added documentation pages for rust and c++
_data/navigation.yml | 8 +--
assets/img/docs/docs-cpp-helloworld.png | Bin 0 -> 2918 bytes
collections/_docs/c.md | 32 ---------
collections/_docs/cpp.md | 124 ++++++++++++++++++++++++++++++++
collections/_docs/rust.md | 54 ++++++++++++++
collections/_docs/vala.md | 21 ------
6 files changed, 182 insertions(+), 57 deletions(-)
---
diff --git a/_data/navigation.yml b/_data/navigation.yml
index ba39c33..da73108 100644
--- a/_data/navigation.yml
+++ b/_data/navigation.yml
@@ -207,12 +207,12 @@ sidebar_links:
- title: Python
name: python
section: Language Bindings
- - title: C
- name: c
+ - title: C++
+ name: cpp
section: Language Bindings
- title: Javascript
name: javascript
section: Language Bindings
- - title: Vala
- name: vala
+ - title: Rust
+ name: rust
section: Language Bindings
\ No newline at end of file
diff --git a/assets/img/docs/docs-cpp-helloworld.png b/assets/img/docs/docs-cpp-helloworld.png
new file mode 100644
index 0000000..e6489b6
Binary files /dev/null and b/assets/img/docs/docs-cpp-helloworld.png differ
diff --git a/collections/_docs/cpp.md b/collections/_docs/cpp.md
new file mode 100644
index 0000000..dc1ed0d
--- /dev/null
+++ b/collections/_docs/cpp.md
@@ -0,0 +1,124 @@
+---
+permalink: /docs/language-bindings/:name/
+---
+# GTKMM
+
+## About
+
+[**gtkmm**](https://www.gtkmm.org/) is the official C++ interface for GTK. Highlights include typesafe
callbacks, and a comprehensive set of widgets that are easily extensible via inheritance. You can create user
interfaces either in code or with the [Glade User Interface designer](http://glade.gnome.org/), using
Gtk::Builder. There's [extensive documentation](https://www.gtkmm.org/en/documentation.shtml), including API
reference and a tutorial.
+
+gtkmm is free software distributed under the GNU Library General Public License (LGPL).
+
+## Releases
+
+gtkmm follows the official GNOME Platform Bindings release schedule. This guarantees API/ABI-stability and
new releases on a predictable schedule, delivering C++ API for the underlying GTK+ and GNOME APIs as soon as
possible.
+
+## gtk-rs Documentation
+
+There is an official [gtkmm API Documentation](https://www.gtkmm.org/en/documentation.html) for using GTK
and C++ together provided on the gtkmm website.
+
+## A Hello World app
+
+```cpp
+// File: helloworld.h
+
+#ifndef GTKMM_EXAMPLE_HELLOWORLD_H
+#define GTKMM_EXAMPLE_HELLOWORLD_H
+
+#include <gtkmm/button.h>
+#include <gtkmm/window.h>
+
+class HelloWorld : public Gtk::Window
+{
+
+public:
+ HelloWorld();
+ virtual ~HelloWorld();
+
+protected:
+ //Signal handlers:
+ void on_button_clicked();
+
+ //Member widgets:
+ Gtk::Button m_button;
+};
+
+#endif
+```
+
+```cpp
+// File: helloworld.cc
+
+#include "helloworld.h"
+#include <iostream>
+
+HelloWorld::HelloWorld()
+: m_button("Hello World") // creates a new button with label "Hello World".
+{
+ // Sets the border width of the window.
+ set_border_width(10);
+
+ // When the button receives the "clicked" signal, it will call the
+ // on_button_clicked() method defined below.
+ m_button.signal_clicked().connect(sigc::mem_fun(*this,
+ &HelloWorld::on_button_clicked));
+
+ // This packs the button into the Window (a container).
+ add(m_button);
+
+ // The final step is to display this newly created widget...
+ m_button.show();
+}
+
+HelloWorld::~HelloWorld()
+{
+}
+
+void HelloWorld::on_button_clicked()
+{
+ std::cout << "Hello World" << std::endl;
+}
+```
+
+```cpp
+// File: main.cc
+
+#include "helloworld.h"
+#include <gtkmm/application.h>
+
+int main (int argc, char *argv[])
+{
+ auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+
+ HelloWorld helloworld;
+
+ //Shows the window and returns when it is closed.
+ return app->run(helloworld);
+}
+```
+
+### Output
+
+After compiling and run the above code and you should see get the below given output:
+
+![gtkmm output for a hello world application](/assets/img/docs/docs-cpp-helloworld.png)
+
+### Explanation
+
+This code depicts how to use GTK C++ binding for creating a simple Hello World application. A more detailed
explanation of the above code can be checked out
[here](https://developer.gnome.org/gtkmm-tutorial/stable/sec-helloworld.html.en).
+
+## Tutorials
+
+You can find various useful tutorials regrading gtkmm from this
[source](https://developer.gnome.org/gtkmm-tutorial/stable/index.html).
+
+## Contribute
+
+If you are interested in contributing to the gtkmm binding project, you can get a head start by reading the
instructions on how to get started for contributing to gtkmm [here](https://www.gtkmm.org/en/developers.html).
+
+If you want to get in touch with the original source files, you can visit the project's [git
repository](https://gitlab.gnome.org/GNOME/gtkmm/) on Gitlab.
+
+## See More
+
+* Project: [https://gitlab.gnome.org/GNOME/gtkmm/](https://gitlab.gnome.org/GNOME/gtkmm/)
+* Docs: [https://www.gtkmm.org/en/documentation.html](https://www.gtkmm.org/en/documentation.html)
+* Tutorial:
[https://developer.gnome.org/gtkmm-tutorial/stable/index.html](https://developer.gnome.org/gtkmm-tutorial/stable/index.html)
\ No newline at end of file
diff --git a/collections/_docs/rust.md b/collections/_docs/rust.md
new file mode 100644
index 0000000..301f660
--- /dev/null
+++ b/collections/_docs/rust.md
@@ -0,0 +1,54 @@
+---
+permalink: /docs/language-bindings/:name/
+---
+# GTK and Rust
+
+## About
+
+[**gtk-rs**](https://gtk-rs.org/) project deals with the Rust bindings for GTK, Cairo, GtkSourceView and
other GLib-compatible libraries.
+
+## gtk-rs Documentation
+
+There is an official [gtk-rs API Documentation](https://gtk-rs.org/docs/gtk/) for using GTK and Rust
together.
+
+There are also a growing number of examples and thorough tests of language features in the test suite.
+
+## A Hello World app
+
+```rust
+extern crate gtk;
+use gtk::prelude::*;
+use gtk::{ButtonsType, DialogFlags, MessageType, MessageDialog, Window};
+
+fn main() {
+ if gtk::init().is_err() {
+ println!("Failed to initialize GTK.");
+ return;
+ }
+ MessageDialog::new(None::<&Window>,
+ DialogFlags::empty(),
+ MessageType::Info,
+ ButtonsType::Ok,
+ "Hello World").run();
+}
+```
+
+### Explanation
+
+This code depicts how to use GTK Rust binding for creating a simple Hello World application.
+
+## Tutorials
+
+[**gtk-rs**](https://gtk-rs.org/) website lists various [tutorials](https://gtk-rs.org/docs-src/tutorial/)
that range from introduction to the usage of Gtk-rs crates and much more. If you want more tutorials please
refer to the [FAQ](https://gtk-rs.org/docs-src/faq) page on the gtk-rs website.
+
+## Contribute
+
+If you are interested in contributing to the gtk-rs binding project, you can get a head start by reading the
instructions on how to get started for contributing to gtk-rs
[here](https://github.com/gtk-rs/gtk#contribute).
+
+If you want to get in touch with the original source files, you can visit the project's [git
repository](https://github.com/gtk-rs/gtk) on Gitlab.
+
+## See More
+
+* Project: [https://github.com/gtk-rs/gtk](https://github.com/gtk-rs/gtk)
+* Docs: [https://gtk-rs.org/docs/gtk/](https://gtk-rs.org/docs/gtk/)
+* Tutorial: [https://gtk-rs.org/docs-src/tutorial/](https://gtk-rs.org/docs-src/tutorial/)
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]