<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="guide" style="task" id="button.js" xml:lang="es">
  <info>
    <link type="guide" xref="beginner.js#buttons"/>
    <revision version="0.1" date="2012-02-21" status="stub"/>

    <credit type="author copyright">
      <name>Susanna Huhtanen</name>
      <email>ihmis.suski@gmail.com</email>
      <years>2012</years>
    </credit>

    <desc>Un widget de botón que está conectado a la barra de progreso</desc>
  </info>

  <title>Widget de botón</title>

  <media type="image" mime="image/png" src="media/button_with_progress_bar.png"/>
  <p>Un widget de botón conectado a una barra de progreso.</p>
  
      <code mime="text/javascript" style="numbered"><![CDATA[
#!/usr/bin/gjs
Gtk = imports.gi.Gtk;
Gtk.init(null, 0);
myW = new Gtk.Window({type: Gtk.WindowType.TOPLEVEL});
myW.title = "Button";
myW.connect("destroy", function(){Gtk.main_quit()});
grid = new Gtk.Grid();
myW.add(grid);
this.pbar = new Gtk.ProgressBar();
function foo(){
  this.pbar.pulse();
}
var button = new Gtk.Button({label: "Button"});
button.connect("clicked", foo);
grid.attach(button, 1, 1, 1, 1);
grid.attach_next_to(pbar, button, 3,1,1);
myW.show_all();
Gtk.main();]]></code>
</page>
