|
Packit |
1470ea |
|
|
Packit |
1470ea |
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" xmlns:ui="http://projectmallard.org/experimental/ui/" type="guide" id="c" xml:lang="ca">
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<info>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<title type="link">C</title>
|
|
Packit |
1470ea |
<link type="guide" xref="index#tutorials"/>
|
|
Packit |
1470ea |
<revision version="3.4" date="2012-04-28" status="stub"/>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<credit type="editor">
|
|
Packit |
1470ea |
<name>Tiffany Antopolski</name>
|
|
Packit |
1470ea |
<email its:translate="no">tiffany.antopolski@gmail.com</email>
|
|
Packit |
1470ea |
</credit>
|
|
Packit |
1470ea |
<credit type="editor">
|
|
Packit |
1470ea |
<name>Bastian Ilso</name>
|
|
Packit |
1470ea |
<email its:translate="no">bastianilso@gnome.org</email>
|
|
Packit |
1470ea |
</credit>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<include xmlns="http://www.w3.org/2001/XInclude" href="legal.xml"/>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<desc>Tutorials and code samples in C.</desc>
|
|
Packit |
1470ea |
</info>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<title>Platform Demos in C</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<section id="prerequisites">
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<title>Prerequisites</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
To compile these platform demos you will need a C compiler, for example
|
|
Packit |
1470ea |
<link href="https://gcc.gnu.org/">gcc</link>.
|
|
Packit |
1470ea |
You will also need GTK+ 3 including headers and pkg-config files.
|
|
Packit |
1470ea |
Linux distributions usually abstract GTK+ 3 headers and pkg-config files
|
|
Packit |
1470ea |
into separate packages called gtk3-devel, gtk3-dev
|
|
Packit |
1470ea |
or similar.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<section id="for-beginners" ui:expanded="false">
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<title>Guidelines for new developers</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
Beyond the prerequisites mentioned above, several tools has been
|
|
Packit |
1470ea |
developed to assist you further in developing your GNOME application.
|
|
Packit |
1470ea |
GNOME also recommends a specific coding style and conventions which this
|
|
Packit |
1470ea |
section will elaborate further upon.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<section id="recommended-tools">
|
|
Packit |
1470ea |
<title>Recommended tools</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<list>
|
|
Packit |
1470ea |
<item>
|
|
Packit |
1470ea |
<link href="https://wiki.gnome.org/Apps/Devhelp">DevHelp</link>:
|
|
Packit |
1470ea |
An API documentation browser for GNOME.
|
|
Packit |
1470ea |
</item>
|
|
Packit |
1470ea |
<item>
|
|
Packit |
1470ea |
A GNOME IDE (Integrated Development Environment).
|
|
Packit |
1470ea |
An IDE can assist you in writing and debugging C code,
|
|
Packit |
1470ea |
for example <link href="https://wiki.gnome.org/Apps/Builder">Builder</link>
|
|
Packit |
1470ea |
or <link href="https://wiki.gnome.org/Apps/Anjuta">Anjuta</link>.
|
|
Packit |
1470ea |
</item>
|
|
Packit |
1470ea |
<item>
|
|
Packit |
1470ea |
<link href="http://glade.gnome.org/">Glade</link>:
|
|
Packit |
1470ea |
A user interface designer for GTK+ Applications.
|
|
Packit |
1470ea |
</item>
|
|
Packit |
1470ea |
<item>
|
|
Packit |
1470ea |
An IRC Client, for example
|
|
Packit |
1470ea |
<link href="https://wiki.gnome.org/Apps/Polari">Polari</link> or
|
|
Packit |
1470ea |
<link href="https://wiki.gnome.org/Apps/Empathy">Empathy</link>.
|
|
Packit |
1470ea |
If you run into problems while following the beginner tutorials,
|
|
Packit |
1470ea |
join #gnome on irc.gnome.org.
|
|
Packit |
1470ea |
</item>
|
|
Packit |
1470ea |
</list>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<section id="coding-style">
|
|
Packit |
1470ea |
<title>Coding Style</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
Most applications in the GNOME project is written in the
|
|
Packit |
1470ea |
<link href="http://en.wikipedia.org/wiki/Indent_style#GNU_style">GNU style</link>
|
|
Packit |
1470ea |
of indentation. The tutorials and code examples presented are following
|
|
Packit |
1470ea |
this convention and you are recommended to do so too.
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<section id="executing-code">
|
|
Packit |
1470ea |
<title>Executing Code</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
To run the code samples:
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<steps>
|
|
Packit |
1470ea |
<item>
|
|
Packit |
1470ea |
Copy and paste the code into filename.c
|
|
Packit |
1470ea |
</item>
|
|
Packit |
1470ea |
<item>
|
|
Packit |
1470ea |
In the terminal type:
|
|
Packit |
1470ea |
<screen>gcc filename.c `pkg-config --cflags --libs gtk+-3.0` -o filename</screen>
|
|
Packit |
1470ea |
<screen>./filename</screen>
|
|
Packit |
1470ea |
</item>
|
|
Packit |
1470ea |
</steps>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<note>
|
|
Packit |
1470ea |
For more information about compiling GTK+ programs see
|
|
Packit |
1470ea |
<link href="http://developer.gnome.org/gtk3/3.4/gtk-compiling.html">Compiling GTK+ Applications on UNIX</link>.
|
|
Packit |
1470ea |
</note>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<section id="examples">
|
|
Packit |
1470ea |
<title>Tutorials</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<section id="samples">
|
|
Packit |
1470ea |
<title>Widget Code Examples</title>
|
|
Packit |
1470ea |
<section id="windows" style="2column"><title>Windows</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="display-widgets" style="2column"><title>Display widgets</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="buttons" style="2column"><title>Buttons and toggles</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="entry" style="2column"><title>Numeric and text data entry</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="multiline" style="2column"><title>Multiline text editor</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="menu-combo-toolbar" style="2column"><title>Menu, combo box and toolbar widgets</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="treeview" style="2column"><title>TreeView widget</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="selectors"><title>Selectors</title>
|
|
Packit |
1470ea |
<section id="file-selectors" style="2column"><title>File selectors</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="font-selectors" style="2column"><title>Font selectors</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="color-selectors" style="2column"><title>Color Selectors</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="layout" style="2column"><title>Layout containers</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="ornaments" style="2column"><title>Ornaments</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="scrolling" style="2column"><title>Scrolling</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
<section id="misc" style="2column"><title>Miscellaneous</title>
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</section>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</page>
|