<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="guide" style="task" id="dialog.vala" xml:lang="es">
  <info>
    <link type="guide" xref="beginner.vala#windows"/>
    <revision version="0.1" date="2012-04-07" status="stub"/>

    <credit type="author copyright">
      <name>Tiffany Antopolski</name>
      <email>tiffany.antopolski@gmail.com</email>
      <years>2012</years>
    </credit>

    <desc>A popup window</desc>
  </info>

  <title>Dialog</title>
  <media type="image" mime="image/png" src="media/dialog.png"/>
  <p>A dialog with the response signal hooked up to a callback function.</p>
  
      <code mime="text/x-vala" style="numbered"><![CDATA[
void on_response (int response_id) {

    /*To see the int value of the ResponseType*/
    print ("response is %d\n", response_id);

    Gtk.main_quit ();
}

int main (string[] args) {

    Gtk.init (ref args);

    var dialog = new Gtk.Dialog.with_buttons ("A Gtk+ Dialog", null, 0, Gtk.Stock.OK, Gtk.ResponseType.OK, null);
    var content_area = dialog.get_content_area () as Gtk.Container; //TODO: explain this
    var label = new Gtk.Label ("This demonstrates a dialog with a label");

    content_area.add (label);
    dialog.response.connect (on_response);
    dialog.show_all ();

    Gtk.main ();
    return 0;
}
]]></code>

<p>En este ejemplo se usa lo siguiente:</p>
<list>
  <item><p><link href="http://www.valadoc.org/#!api=gtk+-3.0/Gtk.Dialog">Gtk.Dialog</link></p></item>
  <item><p><link href="http://www.valadoc.org/#!api=gtk+-3.0/Gtk.Dialog.Dialog.with_buttons">Gtk.Dialog.with_buttons</link></p></item>
  <item><p><link href="http://references.valadoc.org/#!api=gtk+-3.0/Gtk.Label">Gtk.Label</link></p></item>
  <item><p><link href="http://www.valadoc.org/#!api=gtk+-3.0/Gtk.Dialog.get_content_area">get_content_area</link></p></item>
  <item><p><link xref="response-type"/></p></item>
</list>
</page>
