Debian Codegraph @

examples/book/buildapp/step2/exampleappwindow.cc

raw
1 /* gtkmm example Copyright (C) 2016 gtkmm development team
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include "exampleappwindow.h"
18 #include <stdexcept>
19
20 ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
21 const Glib::RefPtr<Gtk::Builder>& refBuilder)
22 : Gtk::ApplicationWindow(cobject),
23 m_refBuilder(refBuilder)
24 {
25 }
26
27 //static
28 ExampleAppWindow* ExampleAppWindow::create()
29 {
30 // Load the Builder file and instantiate its widgets.
31 auto refBuilder = Gtk::Builder::create_from_resource("/org/gtkmm/exampleapp/window.ui");
32
33 auto window = Gtk::Builder::get_widget_derived<ExampleAppWindow>(refBuilder, "app_window");
34 if (!window)
35 throw std::runtime_error("No \"app_window\" object in window.ui");
36
37 return window;
38 }
39
40 void ExampleAppWindow::open_file_view(const Glib::RefPtr<Gio::File>& /* file */)
41 {
42 }