Adding A Content View ===================== In this lesson, you will learn how to modify the UI definition file of the application's window to add a text area UI element. The text area will be used to display the contents of a text file that we are going to load in the next lesson. .. image:: images/content_view.png Any GNOME application is composed of a hierarchy of UI elements, called *widgets*; GTK allows defining UI using XML instead of writing them in code. The default template for GNOME applications provided by Builder uses a UI definition file for the main application window, and we are going to edit it like any other file. 1. Open the ``text_viewer-window.ui`` file under the ``src`` directory 2. The window is defined as a **template** element for the **TextViewerWindow** class 3. The window has **property** elements, which describe the value for the various properties; for instance, setting the default title of the window will be set using the **title** property 4. The window also has two **child** elements - the first **child** element is a **AdwHeaderBar**, and it is used to describe the contents of the header bar; in this case, a **GtkMenuButton** with the primary menu of the application - the second **child** element is the main content area of the window 5. Currently, the main content is provided by a **GtkLabel** widget, with a "Hello, World!" label 6. Outside the **template** block, you can find the definition of the menu using the **menu** element Set the title of the main window -------------------------------- 1. Find the **TextViewerWindow** definition 2. Find the **property** elements that define the default width and height of the window 3. Add the following property: .. code-block:: xml :emphasize-lines: 4