Blob Blame History Raw
<?xml version='1.0' encoding='UTF-8'?>
<page xmlns="http://projectmallard.org/1.0/"
      xmlns:its="http://www.w3.org/2005/11/its"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      type="guide" style="task"
      id="hello-world">

  <info>
    <!-- The text title is used on the help.gnome.org -->
    <title type="link">Hello World (C)</title>
    <link type="guide" xref="c#examples"/>
    <revision version="0.1" date="2013-06-17" status="review"/>

    <credit type="author copyright">
      <name>Susanna Huhtanen</name>
      <email its:translate="no">ihmis.suski@gmail.com</email>
      <years>2012</years>
    </credit>
    <credit type="editor">
      <name>Tiffany Antopolski</name>
      <email its:translate="no">tiffany.antopolski@gmail.com</email>
    </credit>
    <credit type="editor">
      <name>Bastian Ilsø</name>
      <email its:translate="no">bastianilso@gnome.org</email>
    </credit>

    <desc>Creating a small "Hello, World" application using GTK+.</desc>
  </info>

  <title>Hello world</title>

  <note>
    <p>For a detailed walk-through of creating a GTK+ dialog in C, see
    <link href="https://developer.gnome.org/gtk3/stable/gtk-getting-started.html">Getting Started with GTK+</link></p>
  </note>

  <p>Writing a hello world GTK+ dialog in C can be done as seen in the code sample below:</p>
  <code mime="text/x-csrc" style="numbered">
    <xi:include href="samples/hello-in-C/hello-world.c" parse="text"><xi:fallback/></xi:include>
  </code>

  <p>GtkApplication initializes GTK+. It also connects the <gui>x</gui> button
  that's automatically generated along with the window to the "destroy" signal.
  We can start building our first window.
  We do this by creating a variable called <var>window</var> and assigning it
  a gtk_application_window_new. The window title can be any string you want it
  to be. To be on the safe side, it's best to stick to UTF-8 encoding.
  The code above will create a dialog window similar to what can be seen below:</p>

  <media type="image" mime="image/png" src="media/hello-world.png"/>
</page>