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" type="topic" style="task" id="tour-get_object" xml:lang="cs">

  <info>
    <link type="next" xref="tour-application"/>
    <revision version="0.1" date="2013-06-17" status="stub"/>

    <credit type="author copyright">
      <name>Ekaterina Gerasimova</name>
      <email its:translate="no">kittykat3756@gmail.com</email>
      <years>2013</years>
    </credit>
    <credit type="author copyright">
      <name>Gordon Hill</name>
      <email its:translate="no">caseyweederman@gmail.com</email>
      <years>2013</years>
    </credit>

    <include xmlns="http://www.w3.org/2001/XInclude" href="cc-by-sa-3-0.xml"/>

    <desc>Jak přidat okno specifikované v souboru UI do aplikace pomocí GtkBuilder.</desc>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Lucas Lommer</mal:name>
      <mal:email>llommer@svn.gnome.org</mal:email>
      <mal:years>2009.</mal:years>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Marek Černocký</mal:name>
      <mal:email>marek@manet.cz</mal:email>
      <mal:years>2015.</mal:years>
    </mal:credit>
  </info>

  <title>GtkBuilder</title>
  <links type="prevnext" style="top"/>
  <links type="series" style="floatend">
    <title>Začínáme s GNOME</title>
  </links>

  <p>GtkBuilder přebírá popisy UI a vrací je aplikaci Gtk. V tomto případě je popis UI v souboru <file>helloworld.glade</file> a může být přečten metodou <code>get_object()</code>.</p>

  <example>
    <p>Načtěte soubor UI pomocí <code>GtkBuilder</code> a získejte objekt okna pomocí <gui>Názvu</gui> (nebo <gui>ID</gui>) zvoleného v Glade a přidejte objekt okna do aplikace:</p>

    <code>
    _onStartup() {
        let builder = new Gtk.Builder();
        builder.add_from_file('helloworld.glade');
        this._window = builder.get_object('window1');
        this.application.add_window(this._window);
    }
};
</code>
  </example>
  <links type="prevnext"/>
</page>