1 #include <libglademm/xml.h>
5 int main (int argc, char **argv)
7 Gtk::Main kit(argc, argv);
9 //Load the Glade file and instiate its widgets:
10 Glib::RefPtr<Gnome::Glade::Xml> refXml;
13 refXml = Gnome::Glade::Xml::create("basic.glade");
15 catch(const Gnome::Glade::XmlError& ex)
17 std::cerr << ex.what() << std::endl;
21 //Get the Glade-instantiated Dialog:
22 Gtk::Dialog* pDialog = 0;
23 refXml->get_widget("DialogBasic", pDialog);
26 //Get the Glade-instantiated Button, and connect a signal handler:
27 Gtk::Button* pButton = 0;
28 refXml->get_widget("quit_button", pButton);
31 pButton->signal_clicked().connect(SigC::slot(*pDialog, &Gtk::Dialog::hide)); //hide() will cause main::run() to end.