Blame platform-demos/pt_BR/beginner.js.page

Packit 1470ea
Packit 1470ea
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" type="guide" style="task" id="beginner.js" xml:lang="pt-BR">
Packit 1470ea
  <info>
Packit 1470ea
    <link type="guide" xref="js#code-samples"/>
Packit 1470ea
    <revision version="0.2" date="2012-06-10" status="draft"/>
Packit 1470ea
Packit 1470ea
    <credit type="author copyright">
Packit 1470ea
      <name>Susanna Huhtanen</name>
Packit 1470ea
      <email its:translate="no">ihmis.suski@gmail.com</email>
Packit 1470ea
      <years>2012</years>
Packit 1470ea
    </credit>
Packit 1470ea
    <credit type="editor">
Packit 1470ea
      <name>Marta Maria Casetti</name>
Packit 1470ea
      <email its:translate="no">mmcasettii@gmail.com</email>
Packit 1470ea
      <years>2013</years>
Packit 1470ea
    </credit>
Packit 1470ea
Packit 1470ea
    <desc>A beginner's guide to writing GNOME applications in JavaScript, including code samples and practice exercises.</desc>
Packit 1470ea
  
Packit 1470ea
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
Packit 1470ea
      <mal:name>Rafael Ferreira</mal:name>
Packit 1470ea
      <mal:email>rafael.f.f1@gmail.com</mal:email>
Packit 1470ea
      <mal:years>2013</mal:years>
Packit 1470ea
    </mal:credit>
Packit 1470ea
  </info>
Packit 1470ea
Packit 1470ea
  <title>Tutorial for beginners and code samples</title>
Packit 1470ea
<synopsis>
Packit 1470ea
  

JavaScript is one of the most popular programming languages on the web. It's not just for the web, though. If you have even a basic understanding of JavaScript, you can write full-fledged applications for GNOME. <link href="https://wiki.gnome.org/Apps/Documents">GNOME Documents</link> is written in JavaScript, and so is <link href="https://live.gnome.org/GnomeShell/Tour">GNOME Shell</link>, the most basic part of GNOME.

Packit 1470ea
  <note style="tip">

GNOME Shell is what you see when you click on "Activities" in the top-left corner of your screen. It also controls the clock and the rest of the top panel. Besides showing how you to write GNOME applications, these tutorials will also show you how to use JavaScript to write GNOME Shell extensions, which give it new features or change the way it does things.

</note>
Packit 1470ea
</synopsis>
Packit 1470ea
Packit 1470ea
<section id="getting-started">
Packit 1470ea
<title>Getting Started</title>
Packit 1470ea
 

These tutorials are designed for people who already know how to write in JavaScript, and who have GNOME installed on their computers already, but who are new to developing GNOME applications. If you don't already know JavaScript, or if you need help getting GNOME set up, take a look at these resources first:

Packit 1470ea
<steps>
Packit 1470ea
  <item>

<link href="http://eloquentjavascript.net/contents.html">Eloquent JavaScript</link> is a free, Creative Commons-licensed book, which explains the basics of JavaScript programming. Since you won't be writing JavaScript for the web, you only need to read up to chapter 10 or so.

</item>
Packit 1470ea
  <item>

<link href="http://www.gnome.org/getting-gnome/">Download GNOME</link> as part of a distribution, like Fedora, openSUSE, or Ubuntu. Each distribution has its own instructions for how to get GNOME.

</item>
Packit 1470ea
  <item>

<link xref="set-up-gedit.js">Set up gedit</link> for writing applications. GNOME's text editor, gedit, is sometimes just called "text editor".

</item>
Packit 1470ea
</steps>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
Packit 1470ea
<section id="tutorials">
Packit 1470ea
<title>Tutorials</title>
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="samples">
Packit 1470ea
<title>Code samples</title>
Packit 1470ea
  

These samples show how to use widgets in your GNOME applications. Each one demonstrates a complete application which showcases the featured widget. At the end of each sample, you will find links to more detailed reference material.

Packit 1470ea
  

To run the code samples:

Packit 1470ea
  <steps>
Packit 1470ea
    <item>

Copy and paste the code into filename.js

</item>
Packit 1470ea
    <item>

In the terminal, type:

Packit 1470ea
          <screen>gjs filename.js</screen></item>
Packit 1470ea
  </steps>
Packit 1470ea
Packit 1470ea
  <section id="windows" style="2column"><title>Windows</title>
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"><title>File selectors</title>
Packit 1470ea
    </section>
Packit 1470ea
    <section id="font-selectors"><title>Font selectors</title>
Packit 1470ea
    </section>
Packit 1470ea
    <section id="color-selectors"><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
</section>
Packit 1470ea
Packit 1470ea
<section id="exercises">
Packit 1470ea
<title>Exercises</title>
Packit 1470ea
</section>
Packit 1470ea
</page>