Loading the .glade file
| Chapter 23. Glade and libglademm |

## Loading the .glade file

`Gnome::Glade::Xml` must be used via a `Glib::RefPtr`. Like all such classes, you need to use `create()` method to instantiate it.

    Glib::RefPtr<Gnome::Glade::Xml> refXml = Gnome::Glade::Xml::create("basic.glade");

This will instantiate the windows defined in the .glade file, though they will not be shown immediately unless you have specified that via the Properties window in Glade.

To instantiate just one window, or just one of the child widgets, you can specify the name of a widget as the second parameter. For instance,

    Glib::RefPtr<Gnome::Glade::Xml> refXml = Gnome::Glade::Xml::create("basic.glade", "treeview_products");

Chapter 23. Glade and libglademm |  | Accessing widgets