[gtkmm-documentation] Buildapp examples: Use in-class initializers
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] Buildapp examples: Use in-class initializers
- Date: Thu, 14 Jul 2022 12:01:33 +0000 (UTC)
commit 94b396cd6f81c25e609d349d1d6459fbb1ea0564
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Thu Jul 14 13:56:59 2022 +0200
Buildapp examples: Use in-class initializers
examples/book/buildapp/step3/exampleappwindow.cc | 3 +--
examples/book/buildapp/step3/exampleappwindow.h | 2 +-
examples/book/buildapp/step4/exampleappwindow.cc | 4 +---
examples/book/buildapp/step4/exampleappwindow.h | 4 ++--
examples/book/buildapp/step5/exampleappprefs.cc | 5 +----
examples/book/buildapp/step5/exampleappprefs.h | 4 ++--
examples/book/buildapp/step5/exampleappwindow.cc | 5 +----
examples/book/buildapp/step5/exampleappwindow.h | 4 ++--
examples/book/buildapp/step6/exampleappwindow.cc | 9 +--------
examples/book/buildapp/step6/exampleappwindow.h | 10 +++++-----
examples/book/buildapp/step7/exampleappwindow.cc | 11 +----------
examples/book/buildapp/step7/exampleappwindow.h | 14 +++++++-------
examples/book/buildapp/step8/exampleappwindow.cc | 14 +-------------
examples/book/buildapp/step8/exampleappwindow.h | 18 +++++++++---------
examples/book/buildapp/step9/exampleappwindow.cc | 14 +-------------
15 files changed, 36 insertions(+), 85 deletions(-)
---
diff --git a/examples/book/buildapp/step3/exampleappwindow.cc
b/examples/book/buildapp/step3/exampleappwindow.cc
index f6a1d0b..1ee7b60 100644
--- a/examples/book/buildapp/step3/exampleappwindow.cc
+++ b/examples/book/buildapp/step3/exampleappwindow.cc
@@ -20,8 +20,7 @@
ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refBuilder)
: Gtk::ApplicationWindow(cobject),
- m_refBuilder(refBuilder),
- m_stack(nullptr)
+ m_refBuilder(refBuilder)
{
m_stack = m_refBuilder->get_widget<Gtk::Stack>("stack");
if (!m_stack)
diff --git a/examples/book/buildapp/step3/exampleappwindow.h b/examples/book/buildapp/step3/exampleappwindow.h
index 67f5511..1d461b7 100644
--- a/examples/book/buildapp/step3/exampleappwindow.h
+++ b/examples/book/buildapp/step3/exampleappwindow.h
@@ -30,7 +30,7 @@ public:
protected:
Glib::RefPtr<Gtk::Builder> m_refBuilder;
- Gtk::Stack* m_stack;
+ Gtk::Stack* m_stack {nullptr};
};
#endif /* GTKMM_EXAMPLEAPPWINDOW_H */
diff --git a/examples/book/buildapp/step4/exampleappwindow.cc
b/examples/book/buildapp/step4/exampleappwindow.cc
index 1795bcf..0201535 100644
--- a/examples/book/buildapp/step4/exampleappwindow.cc
+++ b/examples/book/buildapp/step4/exampleappwindow.cc
@@ -20,9 +20,7 @@
ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refBuilder)
: Gtk::ApplicationWindow(cobject),
- m_refBuilder(refBuilder),
- m_stack(nullptr),
- m_gears(nullptr)
+ m_refBuilder(refBuilder)
{
// Get widgets from the Gtk::Builder file.
m_stack = m_refBuilder->get_widget<Gtk::Stack>("stack");
diff --git a/examples/book/buildapp/step4/exampleappwindow.h b/examples/book/buildapp/step4/exampleappwindow.h
index a4b0f26..a2b63b4 100644
--- a/examples/book/buildapp/step4/exampleappwindow.h
+++ b/examples/book/buildapp/step4/exampleappwindow.h
@@ -30,8 +30,8 @@ public:
protected:
Glib::RefPtr<Gtk::Builder> m_refBuilder;
- Gtk::Stack* m_stack;
- Gtk::MenuButton* m_gears;
+ Gtk::Stack* m_stack {nullptr};
+ Gtk::MenuButton* m_gears {nullptr};
};
#endif /* GTKMM_EXAMPLEAPPWINDOW_H */
diff --git a/examples/book/buildapp/step5/exampleappprefs.cc b/examples/book/buildapp/step5/exampleappprefs.cc
index b599cde..c7b4f67 100644
--- a/examples/book/buildapp/step5/exampleappprefs.cc
+++ b/examples/book/buildapp/step5/exampleappprefs.cc
@@ -20,10 +20,7 @@
ExampleAppPrefs::ExampleAppPrefs(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refBuilder)
: Gtk::Dialog(cobject),
- m_refBuilder(refBuilder),
- m_settings(),
- m_font(nullptr),
- m_transition(nullptr)
+ m_refBuilder(refBuilder)
{
m_font = m_refBuilder->get_widget<Gtk::FontButton>("font");
if (!m_font)
diff --git a/examples/book/buildapp/step5/exampleappprefs.h b/examples/book/buildapp/step5/exampleappprefs.h
index c539aff..649dd9d 100644
--- a/examples/book/buildapp/step5/exampleappprefs.h
+++ b/examples/book/buildapp/step5/exampleappprefs.h
@@ -29,8 +29,8 @@ public:
protected:
Glib::RefPtr<Gtk::Builder> m_refBuilder;
Glib::RefPtr<Gio::Settings> m_settings;
- Gtk::FontButton* m_font;
- Gtk::ComboBoxText* m_transition;
+ Gtk::FontButton* m_font {nullptr};
+ Gtk::ComboBoxText* m_transition {nullptr};
};
#endif /* GTKMM_EXAMPLEAPPPREFS_H_ */
diff --git a/examples/book/buildapp/step5/exampleappwindow.cc
b/examples/book/buildapp/step5/exampleappwindow.cc
index 8b6a23b..094a867 100644
--- a/examples/book/buildapp/step5/exampleappwindow.cc
+++ b/examples/book/buildapp/step5/exampleappwindow.cc
@@ -20,10 +20,7 @@
ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refBuilder)
: Gtk::ApplicationWindow(cobject),
- m_refBuilder(refBuilder),
- m_settings(),
- m_stack(nullptr),
- m_gears(nullptr)
+ m_refBuilder(refBuilder)
{
// Get widgets from the Gtk::Builder file.
m_stack = m_refBuilder->get_widget<Gtk::Stack>("stack");
diff --git a/examples/book/buildapp/step5/exampleappwindow.h b/examples/book/buildapp/step5/exampleappwindow.h
index b90b752..391aeda 100644
--- a/examples/book/buildapp/step5/exampleappwindow.h
+++ b/examples/book/buildapp/step5/exampleappwindow.h
@@ -31,8 +31,8 @@ public:
protected:
Glib::RefPtr<Gtk::Builder> m_refBuilder;
Glib::RefPtr<Gio::Settings> m_settings;
- Gtk::Stack* m_stack;
- Gtk::MenuButton* m_gears;
+ Gtk::Stack* m_stack {nullptr};
+ Gtk::MenuButton* m_gears {nullptr};
};
#endif /* GTKMM_EXAMPLEAPPWINDOW_H */
diff --git a/examples/book/buildapp/step6/exampleappwindow.cc
b/examples/book/buildapp/step6/exampleappwindow.cc
index 5f8b286..61929a6 100644
--- a/examples/book/buildapp/step6/exampleappwindow.cc
+++ b/examples/book/buildapp/step6/exampleappwindow.cc
@@ -20,14 +20,7 @@
ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refBuilder)
: Gtk::ApplicationWindow(cobject),
- m_refBuilder(refBuilder),
- m_settings(),
- m_stack(nullptr),
- m_search(nullptr),
- m_searchbar(nullptr),
- m_searchentry(nullptr),
- m_gears(nullptr),
- m_prop_binding()
+ m_refBuilder(refBuilder)
{
// Get widgets from the Gtk::Builder file.
m_stack = m_refBuilder->get_widget<Gtk::Stack>("stack");
diff --git a/examples/book/buildapp/step6/exampleappwindow.h b/examples/book/buildapp/step6/exampleappwindow.h
index 954ca68..a73358c 100644
--- a/examples/book/buildapp/step6/exampleappwindow.h
+++ b/examples/book/buildapp/step6/exampleappwindow.h
@@ -35,11 +35,11 @@ protected:
Glib::RefPtr<Gtk::Builder> m_refBuilder;
Glib::RefPtr<Gio::Settings> m_settings;
- Gtk::Stack* m_stack;
- Gtk::ToggleButton* m_search;
- Gtk::SearchBar* m_searchbar;
- Gtk::SearchEntry* m_searchentry;
- Gtk::MenuButton* m_gears;
+ Gtk::Stack* m_stack {nullptr};
+ Gtk::ToggleButton* m_search {nullptr};
+ Gtk::SearchBar* m_searchbar {nullptr};
+ Gtk::SearchEntry* m_searchentry {nullptr};
+ Gtk::MenuButton* m_gears {nullptr};
Glib::RefPtr<Glib::Binding> m_prop_binding;
};
diff --git a/examples/book/buildapp/step7/exampleappwindow.cc
b/examples/book/buildapp/step7/exampleappwindow.cc
index 32b2b20..ae047c5 100644
--- a/examples/book/buildapp/step7/exampleappwindow.cc
+++ b/examples/book/buildapp/step7/exampleappwindow.cc
@@ -21,16 +21,7 @@
ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refBuilder)
: Gtk::ApplicationWindow(cobject),
- m_refBuilder(refBuilder),
- m_settings(),
- m_stack(nullptr),
- m_search(nullptr),
- m_searchbar(nullptr),
- m_searchentry(nullptr),
- m_gears(nullptr),
- m_sidebar(nullptr),
- m_words(nullptr),
- m_prop_binding()
+ m_refBuilder(refBuilder)
{
// Get widgets from the Gtk::Builder file.
m_stack = m_refBuilder->get_widget<Gtk::Stack>("stack");
diff --git a/examples/book/buildapp/step7/exampleappwindow.h b/examples/book/buildapp/step7/exampleappwindow.h
index 35ebacb..83e50bb 100644
--- a/examples/book/buildapp/step7/exampleappwindow.h
+++ b/examples/book/buildapp/step7/exampleappwindow.h
@@ -39,13 +39,13 @@ protected:
Glib::RefPtr<Gtk::Builder> m_refBuilder;
Glib::RefPtr<Gio::Settings> m_settings;
- Gtk::Stack* m_stack;
- Gtk::ToggleButton* m_search;
- Gtk::SearchBar* m_searchbar;
- Gtk::SearchEntry* m_searchentry;
- Gtk::MenuButton* m_gears;
- Gtk::Revealer* m_sidebar;
- Gtk::ListBox* m_words;
+ Gtk::Stack* m_stack {nullptr};
+ Gtk::ToggleButton* m_search {nullptr};
+ Gtk::SearchBar* m_searchbar {nullptr};
+ Gtk::SearchEntry* m_searchentry {nullptr};
+ Gtk::MenuButton* m_gears {nullptr};
+ Gtk::Revealer* m_sidebar {nullptr};
+ Gtk::ListBox* m_words {nullptr};
Glib::RefPtr<Glib::Binding> m_prop_binding;
};
diff --git a/examples/book/buildapp/step8/exampleappwindow.cc
b/examples/book/buildapp/step8/exampleappwindow.cc
index a73cd83..da3bc90 100644
--- a/examples/book/buildapp/step8/exampleappwindow.cc
+++ b/examples/book/buildapp/step8/exampleappwindow.cc
@@ -21,19 +21,7 @@
ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refBuilder)
: Gtk::ApplicationWindow(cobject),
- m_refBuilder(refBuilder),
- m_settings(),
- m_stack(nullptr),
- m_search(nullptr),
- m_searchbar(nullptr),
- m_searchentry(nullptr),
- m_gears(nullptr),
- m_sidebar(nullptr),
- m_words(nullptr),
- m_lines(nullptr),
- m_lines_label(nullptr),
- m_binding_search_enabled(),
- m_binding_lines_visible()
+ m_refBuilder(refBuilder)
{
// Get widgets from the Gtk::Builder file.
m_stack = m_refBuilder->get_widget<Gtk::Stack>("stack");
diff --git a/examples/book/buildapp/step8/exampleappwindow.h b/examples/book/buildapp/step8/exampleappwindow.h
index bcc3dcb..d259c63 100644
--- a/examples/book/buildapp/step8/exampleappwindow.h
+++ b/examples/book/buildapp/step8/exampleappwindow.h
@@ -40,15 +40,15 @@ protected:
Glib::RefPtr<Gtk::Builder> m_refBuilder;
Glib::RefPtr<Gio::Settings> m_settings;
- Gtk::Stack* m_stack;
- Gtk::ToggleButton* m_search;
- Gtk::SearchBar* m_searchbar;
- Gtk::SearchEntry* m_searchentry;
- Gtk::MenuButton* m_gears;
- Gtk::Revealer* m_sidebar;
- Gtk::ListBox* m_words;
- Gtk::Label* m_lines;
- Gtk::Label* m_lines_label;
+ Gtk::Stack* m_stack {nullptr};
+ Gtk::ToggleButton* m_search {nullptr};
+ Gtk::SearchBar* m_searchbar {nullptr};
+ Gtk::SearchEntry* m_searchentry {nullptr};
+ Gtk::MenuButton* m_gears {nullptr};
+ Gtk::Revealer* m_sidebar {nullptr};
+ Gtk::ListBox* m_words {nullptr};
+ Gtk::Label* m_lines {nullptr};
+ Gtk::Label* m_lines_label {nullptr};
Glib::RefPtr<Glib::Binding> m_binding_search_enabled;
Glib::RefPtr<Glib::Binding> m_binding_lines_visible;
};
diff --git a/examples/book/buildapp/step9/exampleappwindow.cc
b/examples/book/buildapp/step9/exampleappwindow.cc
index 61632b8..fd0c8ca 100644
--- a/examples/book/buildapp/step9/exampleappwindow.cc
+++ b/examples/book/buildapp/step9/exampleappwindow.cc
@@ -21,19 +21,7 @@
ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refBuilder)
: Gtk::ApplicationWindow(cobject),
- m_refBuilder(refBuilder),
- m_settings(),
- m_stack(nullptr),
- m_search(nullptr),
- m_searchbar(nullptr),
- m_searchentry(nullptr),
- m_gears(nullptr),
- m_sidebar(nullptr),
- m_words(nullptr),
- m_lines(nullptr),
- m_lines_label(nullptr),
- m_binding_search_enabled(),
- m_binding_lines_visible()
+ m_refBuilder(refBuilder)
{
// Get widgets from the Gtk::Builder file.
m_stack = m_refBuilder->get_widget<Gtk::Stack>("stack");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]