[gtkmm] Fix 'make check'
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Fix 'make check'
- Date: Tue, 8 Nov 2016 16:05:44 +0000 (UTC)
commit dd98c03af3daf8a053f7be44f8e09bb92968c012
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Tue Nov 8 17:00:07 2016 +0100
Fix 'make check'
Replace all usage of removed API. Most of the changes replace calls to
Gtk::Container::set_border_width() by Gtk::Widget::property_margin().
demos/gtk-demo/demos.h | 2 +-
demos/gtk-demo/example_builder.ui | 3 +-
demos/gtk-demo/example_buttonbox.cc | 18 +++++++----
demos/gtk-demo/example_change_display.cc | 4 +-
demos/gtk-demo/example_colorsel.cc | 3 +-
demos/gtk-demo/example_dialog.cc | 5 +--
demos/gtk-demo/example_drawingarea.cc | 3 +-
demos/gtk-demo/example_flowbox.cc | 2 +-
demos/gtk-demo/example_glarea.cc | 2 +-
demos/gtk-demo/example_images.cc | 3 +-
demos/gtk-demo/example_menus.cc | 5 +--
demos/gtk-demo/example_overlay.cc | 1 -
demos/gtk-demo/example_panes.cc | 34 +++++++--------------
demos/gtk-demo/example_sizegroup.cc | 6 ++--
demos/gtk-demo/example_textview.cc | 3 +-
demos/gtk-demo/example_treeview_editable_cells.cc | 2 +-
demos/gtk-demo/example_treeview_liststore.cc | 2 +-
demos/gtk-demo/example_treeview_treestore.cc | 2 +-
tests/builder/main.cc | 5 +--
19 files changed, 44 insertions(+), 61 deletions(-)
---
diff --git a/demos/gtk-demo/demos.h b/demos/gtk-demo/demos.h
index ab21615..8a95283 100644
--- a/demos/gtk-demo/demos.h
+++ b/demos/gtk-demo/demos.h
@@ -56,7 +56,7 @@ Demo testgtk_demos[] =
{ "Builder", "example_builder.cc", sigc::ptr_fun(&do_builder), nullptr },
{ "Button Boxes", "example_buttonbox.cc", sigc::ptr_fun(&do_buttonbox), nullptr },
{ "Change Display", "example_change_display.cc", sigc::ptr_fun(&do_change_display), nullptr },
- { "Color Selector", "example_colorsel.cc", sigc::ptr_fun(&do_colorsel), nullptr },
+ { "Color Chooser", "example_colorsel.cc", sigc::ptr_fun(&do_colorsel), nullptr },
{ "Dialog and Message Boxes", "example_dialog.cc", sigc::ptr_fun(&do_dialog), nullptr },
{ "Drawing Area", "example_drawingarea.cc", sigc::ptr_fun(&do_drawingarea), nullptr },
{ "Flow Box", "example_flowbox.cc", sigc::ptr_fun(&do_flowbox), nullptr },
diff --git a/demos/gtk-demo/example_builder.ui b/demos/gtk-demo/example_builder.ui
index 9adca83..ec67917 100644
--- a/demos/gtk-demo/example_builder.ui
+++ b/demos/gtk-demo/example_builder.ui
@@ -35,8 +35,9 @@
<property name="default_width">440</property>
<property name="title">Gtk::Builder demo</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkBox" id="vbox1">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkMenuBar" id="menubar1">
<property name="visible">True</property>
diff --git a/demos/gtk-demo/example_buttonbox.cc b/demos/gtk-demo/example_buttonbox.cc
index 42680ad..0f9a7ac 100644
--- a/demos/gtk-demo/example_buttonbox.cc
+++ b/demos/gtk-demo/example_buttonbox.cc
@@ -36,13 +36,15 @@ Example_ButtonBox::Example_ButtonBox()
m_HBox(Gtk::ORIENTATION_HORIZONTAL)
{
set_title("Button Boxes");
- set_border_width(10);
+ m_VBox_Main.property_margin() = 10;
add(m_VBox_Main);
+ m_Frame_Horizontal.set_margin_top(10);
+ m_Frame_Horizontal.set_margin_bottom(10);
m_VBox_Main.pack_start(m_Frame_Horizontal, Gtk::PACK_EXPAND_WIDGET, 10);
- m_VBox.set_border_width(10);
+ m_VBox.property_margin() = 10;
m_Frame_Horizontal.add(m_VBox);
m_VBox.pack_start( *(create_button_box(true, "Spread", 40, Gtk::BUTTONBOX_SPREAD)) );
@@ -52,7 +54,7 @@ Example_ButtonBox::Example_ButtonBox()
m_VBox_Main.pack_start(m_Frame_Vertical, Gtk::PACK_EXPAND_WIDGET, 10);
- m_VBox.set_border_width(10);
+ m_HBox.property_margin() = 10;
m_Frame_Vertical.add(m_HBox);
m_HBox.pack_start( *(create_button_box(false, "Spread", 30, Gtk::BUTTONBOX_SPREAD)) );
@@ -75,9 +77,13 @@ Gtk::Frame* Example_ButtonBox::create_button_box(bool horizontal, const Glib::us
if (horizontal)
pButtonBox = Gtk::manage(new Gtk::ButtonBox(Gtk::ORIENTATION_HORIZONTAL));
else
+ {
pButtonBox = Gtk::manage(new Gtk::ButtonBox(Gtk::ORIENTATION_VERTICAL));
+ pFrame->set_margin_start(5);
+ pFrame->set_margin_end(5);
+ }
- pButtonBox->set_border_width(5);
+ pButtonBox->property_margin() = 5;
pFrame->add(*pButtonBox);
pButtonBox->set_layout(layout);
@@ -90,9 +96,7 @@ Gtk::Frame* Example_ButtonBox::create_button_box(bool horizontal, const Glib::us
pButtonBox->add(*pButton);
pButton = Gtk::manage(new Gtk::Button());
- Gtk::Image* pImage = Gtk::manage(new Gtk::Image());
- pImage->set_from_icon_name("help-browser", Gtk::ICON_SIZE_BUTTON);
- pButton->add(*pImage);
+ pButton->set_icon_name("help-browser");
pButtonBox->add(*pButton);
return pFrame;
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index 8f90b9a..be39f09 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -112,7 +112,7 @@ Example_ChangeDisplay::Example_ChangeDisplay()
set_default_size(300, 400);
- m_VBox.set_border_width(8);
+ m_VBox.property_margin() = 8;
get_content_area()->pack_start(m_VBox);
@@ -156,7 +156,7 @@ Example_ChangeDisplay::~Example_ChangeDisplay()
void Example_ChangeDisplay::setup_frame(Gtk::Frame& frame, Gtk::TreeView& treeview, Gtk::Box& buttonbox)
{
Gtk::Box* pHBox = Gtk::manage( new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 8) );
- pHBox->set_border_width(8);
+ pHBox->property_margin() = 8;
frame.add(*pHBox);
Gtk::ScrolledWindow* pScrolledWindow = Gtk::manage( new Gtk::ScrolledWindow() );
diff --git a/demos/gtk-demo/example_colorsel.cc b/demos/gtk-demo/example_colorsel.cc
index 2b795d4..38bab06 100644
--- a/demos/gtk-demo/example_colorsel.cc
+++ b/demos/gtk-demo/example_colorsel.cc
@@ -36,9 +36,8 @@ Example_ColorSel::Example_ColorSel()
m_Button("_Change the above color", true)
{
set_title("Color Chooser");
- set_border_width(8);
- m_VBox.set_border_width(8);
+ m_VBox.property_margin() = 12;
add(m_VBox);
// Create the color swatch area
diff --git a/demos/gtk-demo/example_dialog.cc b/demos/gtk-demo/example_dialog.cc
index 49d89f6..2273207 100644
--- a/demos/gtk-demo/example_dialog.cc
+++ b/demos/gtk-demo/example_dialog.cc
@@ -67,11 +67,11 @@ Example_Dialog::Example_Dialog()
m_count = 0;
set_title("Dialogs");
- set_border_width(8);
+ m_Frame.property_margin() = 8;
add(m_Frame);
- m_VBox.set_border_width(8);
+ m_VBox.property_margin() = 8;
m_Frame.add(m_VBox);
@@ -142,7 +142,6 @@ Dialog_Interactive::Dialog_Interactive(Gtk::Window& parent, const Glib::ustring&
add_button("_OK", Gtk::RESPONSE_OK);
add_button("_Cancel", Gtk::RESPONSE_CANCEL);
- m_HBox.set_border_width(8);
get_content_area()->pack_start(m_HBox, Gtk::PACK_SHRINK);
m_HBox.pack_start(m_Image, Gtk::PACK_SHRINK);
diff --git a/demos/gtk-demo/example_drawingarea.cc b/demos/gtk-demo/example_drawingarea.cc
index 858e4db..1195cc5 100644
--- a/demos/gtk-demo/example_drawingarea.cc
+++ b/demos/gtk-demo/example_drawingarea.cc
@@ -51,9 +51,8 @@ Example_DrawingArea::Example_DrawingArea()
m_VBox(Gtk::ORIENTATION_VERTICAL, 8)
{
set_title("Drawing Area");
- set_border_width(8);
- m_VBox.set_border_width(8);
+ m_VBox.property_margin() = 16;
add(m_VBox);
/*
diff --git a/demos/gtk-demo/example_flowbox.cc b/demos/gtk-demo/example_flowbox.cc
index ed5f9be..05e46cd 100644
--- a/demos/gtk-demo/example_flowbox.cc
+++ b/demos/gtk-demo/example_flowbox.cc
@@ -40,9 +40,9 @@ Example_FlowBox::Example_FlowBox()
// Window properties
set_title("FlowBox Example");
set_default_size(600, 400);
- set_border_width(6);
// Scrolled window
+ m_scrolled_window.property_margin() = 6;
m_scrolled_window.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
// Flow box
diff --git a/demos/gtk-demo/example_glarea.cc b/demos/gtk-demo/example_glarea.cc
index b9b7b3b..ac960e6 100644
--- a/demos/gtk-demo/example_glarea.cc
+++ b/demos/gtk-demo/example_glarea.cc
@@ -70,8 +70,8 @@ Example_GLArea::Example_GLArea() : m_RotationAngles(N_AXIS, 0.0f)
{
set_title("GL Area");
set_default_size(400, 600);
- set_border_width(12);
+ m_VBox.property_margin() = 12;
m_VBox.set_spacing(6);
add(m_VBox);
diff --git a/demos/gtk-demo/example_images.cc b/demos/gtk-demo/example_images.cc
index 53fe4c5..42c7335 100644
--- a/demos/gtk-demo/example_images.cc
+++ b/demos/gtk-demo/example_images.cc
@@ -50,9 +50,8 @@ Example_Images::Example_Images()
m_image_stream ()
{
set_title("Images");
- set_border_width(8);
- m_VBox.set_border_width(8);
+ m_VBox.property_margin() = 16;
add(m_VBox);
/* Image */
diff --git a/demos/gtk-demo/example_menus.cc b/demos/gtk-demo/example_menus.cc
index 69f555d..72edcb1 100644
--- a/demos/gtk-demo/example_menus.cc
+++ b/demos/gtk-demo/example_menus.cc
@@ -60,7 +60,6 @@ Example_Menus::Example_Menus()
m_Button("close")
{
set_title("menus");
- set_border_width(0);
add(m_VBox1);
@@ -85,7 +84,7 @@ Example_Menus::Example_Menus()
}
- m_VBox_Sub1.set_border_width(10);
+ m_VBox_Sub1.property_margin() = 10;
m_VBox1.pack_start(m_VBox_Sub1);
{
@@ -115,7 +114,7 @@ Example_Menus::Example_Menus()
m_VBox1.pack_start(m_Separator, Gtk::PACK_SHRINK);
- m_VBox_Sub2.set_border_width(10);
+ m_VBox_Sub2.property_margin() = 10;
m_VBox1.pack_start(m_VBox_Sub2, Gtk::PACK_SHRINK);
m_Button.signal_clicked().connect(sigc::mem_fun(*this, &Example_Menus::on_button_clicked));
diff --git a/demos/gtk-demo/example_overlay.cc b/demos/gtk-demo/example_overlay.cc
index 072ebac..d3a1665 100644
--- a/demos/gtk-demo/example_overlay.cc
+++ b/demos/gtk-demo/example_overlay.cc
@@ -37,7 +37,6 @@ Example_Overlay::Example_Overlay()
// Window properties
set_default_size(450, 450);
set_title("Overlay");
- set_border_width(0);
// Main text view
m_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
diff --git a/demos/gtk-demo/example_panes.cc b/demos/gtk-demo/example_panes.cc
index c49d88b..294381f 100644
--- a/demos/gtk-demo/example_panes.cc
+++ b/demos/gtk-demo/example_panes.cc
@@ -1,14 +1,14 @@
/* Paned Widgets
*
- * The GtkHPaned and GtkVPaned Widgets divide their content
- * area into two panes with a divider in between that the
- * user can adjust. A separate child is placed into each
- * pane.
+ * The Gtk::Paned Widget divides its content area into two panes
+ * with a divider in between that the user can adjust. A separate
+ * child is placed into each pane. Gtk::Paned widgets can be split
+ * horizontally or vertially.
*
* There are a number of options that can be set for each pane.
- * This test contains both a horizontal (HPaned) and a vertical
- * (VPaned) widget, and allows you to adjust the options for
- * each side of each widget.
+ * This test contains both a horizontal and a vertical Gtk::Paned
+ * widget, and allows you to adjust the options for each side of
+ * each widget.
*/
#include <gtkmm.h>
@@ -47,14 +47,13 @@ private:
Example_Panes::Example_Panes()
{
set_title("Panes");
- set_border_width(0);
Gtk::Box *const pVBox = new Gtk::Box(Gtk::ORIENTATION_VERTICAL);
add(*Gtk::manage(pVBox));
Gtk::Paned *const pVPaned = new Gtk::Paned(Gtk::ORIENTATION_VERTICAL);
pVBox->pack_start(*Gtk::manage(pVPaned));
- pVPaned->set_border_width(5);
+ pVPaned->property_margin() = 5;
Gtk::Paned *const pHPaned = new Gtk::Paned(Gtk::ORIENTATION_HORIZONTAL);
pVPaned->add1(*Gtk::manage(pHPaned));
@@ -96,9 +95,8 @@ PaneOptions::PaneOptions(Gtk::Paned& paned, const Glib::ustring& frame_label,
m_CheckButton_resize2 ("_Resize", true),
m_CheckButton_shrink2 ("_Shrink", true)
{
- set_border_width(4);
-
Gtk::Grid *const pGrid = new Gtk::Grid();
+ pGrid->property_margin() = 4;
add(*Gtk::manage(pGrid));
pGrid->attach(*Gtk::manage(new Gtk::Label(label1)), 0, 0, 1, 1);
@@ -131,28 +129,18 @@ PaneOptions::~PaneOptions()
void PaneOptions::on_checkbutton1()
{
- Gtk::AttachOptions options = Gtk::AttachOptions(0);
-
- if(m_CheckButton_resize1.get_active()) options = (options | Gtk::EXPAND);
- if(m_CheckButton_shrink1.get_active()) options = (options | Gtk::SHRINK);
-
Gtk::Widget *const pChild = m_pPaned->get_child1();
m_pPaned->remove(*pChild);
- m_pPaned->pack1(*pChild, options);
+ m_pPaned->pack1(*pChild, m_CheckButton_resize1.get_active(), m_CheckButton_shrink1.get_active());
}
void PaneOptions::on_checkbutton2()
{
- Gtk::AttachOptions options = Gtk::AttachOptions(0);
-
- if(m_CheckButton_resize2.get_active()) options = (options | Gtk::EXPAND);
- if(m_CheckButton_shrink2.get_active()) options = (options | Gtk::SHRINK);
-
Gtk::Widget *const pChild = m_pPaned->get_child2();
m_pPaned->remove(*pChild);
- m_pPaned->pack2(*pChild, options);
+ m_pPaned->pack2(*pChild, m_CheckButton_resize2.get_active(), m_CheckButton_shrink2.get_active());
}
} // anonymous namespace
diff --git a/demos/gtk-demo/example_sizegroup.cc b/demos/gtk-demo/example_sizegroup.cc
index aa3e904..f4d1ef0 100644
--- a/demos/gtk-demo/example_sizegroup.cc
+++ b/demos/gtk-demo/example_sizegroup.cc
@@ -59,7 +59,7 @@ Example_SizeGroup::Example_SizeGroup()
add_button("_Close", Gtk::RESPONSE_CLOSE);
get_content_area()->pack_start(m_VBox);
- m_VBox.set_border_width(5);
+ m_VBox.property_margin() = 5;
m_refSizeGroup = Gtk::SizeGroup::create(Gtk::SIZE_GROUP_HORIZONTAL),
@@ -67,7 +67,7 @@ Example_SizeGroup::Example_SizeGroup()
*/
m_VBox.pack_start(m_Frame_Color);
- m_Grid_Color.set_border_width(5);
+ m_Grid_Color.property_margin() = 5;
m_Grid_Color.set_row_spacing(5);
m_Grid_Color.set_column_spacing(10);
m_Frame_Color.add(m_Grid_Color);
@@ -84,7 +84,7 @@ Example_SizeGroup::Example_SizeGroup()
*/
m_VBox.pack_start(m_Frame_Line, Gtk::PACK_SHRINK);
- m_Grid_Line.set_border_width(5);
+ m_Grid_Line.property_margin() = 5;
m_Grid_Line.set_row_spacing(5);
m_Grid_Line.set_column_spacing(10);
m_Frame_Line.add(m_Grid_Line);
diff --git a/demos/gtk-demo/example_textview.cc b/demos/gtk-demo/example_textview.cc
index ea13b76..c12719a 100644
--- a/demos/gtk-demo/example_textview.cc
+++ b/demos/gtk-demo/example_textview.cc
@@ -66,9 +66,8 @@ Example_TextView::Example_TextView()
{
set_default_size(450, 450);
set_title("Text View");
- set_border_width(0);
- m_VPaned.set_border_width(5);
+ m_VPaned.property_margin() = 5;
add(m_VPaned);
/* For convenience, we just use the autocreated buffer from
diff --git a/demos/gtk-demo/example_treeview_editable_cells.cc
b/demos/gtk-demo/example_treeview_editable_cells.cc
index 9d7a306..6a2e761 100644
--- a/demos/gtk-demo/example_treeview_editable_cells.cc
+++ b/demos/gtk-demo/example_treeview_editable_cells.cc
@@ -105,9 +105,9 @@ Example_TreeView_EditableCells::Example_TreeView_EditableCells()
m_Button_Remove("Remove item")
{
set_title("Shopping List");
- set_border_width(5);
set_default_size(320, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
m_VBox.pack_start(m_Label, Gtk::PACK_SHRINK);
diff --git a/demos/gtk-demo/example_treeview_liststore.cc b/demos/gtk-demo/example_treeview_liststore.cc
index 975ea52..1cf076b 100644
--- a/demos/gtk-demo/example_treeview_liststore.cc
+++ b/demos/gtk-demo/example_treeview_liststore.cc
@@ -104,9 +104,9 @@ Example_TreeView_ListStore::Example_TreeView_ListStore()
m_Label("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC
interface to bugzilla or so, though).")
{
set_title("Gtk::ListStore demo");
- set_border_width(8);
set_default_size(280, 250);
+ m_VBox.property_margin() = 8;
add(m_VBox);
m_VBox.pack_start(m_Label, Gtk::PACK_SHRINK);
diff --git a/demos/gtk-demo/example_treeview_treestore.cc b/demos/gtk-demo/example_treeview_treestore.cc
index f5a4e51..87afd24 100644
--- a/demos/gtk-demo/example_treeview_treestore.cc
+++ b/demos/gtk-demo/example_treeview_treestore.cc
@@ -150,9 +150,9 @@ Example_TreeView_TreeStore::Example_TreeView_TreeStore()
m_Label("Jonathan's Holiday Card Planning Sheet")
{
set_title("Card planning sheet");
- set_border_width(8);
set_default_size(650, 400);
+ m_VBox.property_margin() = 8;
add(m_VBox);
m_VBox.pack_start(m_Label, Gtk::PACK_SHRINK);
diff --git a/tests/builder/main.cc b/tests/builder/main.cc
index 02a8043..65bb33c 100644
--- a/tests/builder/main.cc
+++ b/tests/builder/main.cc
@@ -98,10 +98,7 @@ public:
std::cout << "DerivedButton::ctor" << std::endl;
if (!icon_name.empty())
- {
- set_image_from_icon_name(icon_name);
- property_always_show_image() = true;
- }
+ set_icon_name(icon_name);
}
virtual ~DerivedButton()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]