[gtkmm-documentation] Update many example applications, fixing 'make check'
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] Update many example applications, fixing 'make check'
- Date: Mon, 21 Nov 2016 08:17:30 +0000 (UTC)
commit 5b917b09fc887bd19b60edd0a8bb3b1025f85317
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Mon Nov 21 09:08:48 2016 +0100
Update many example applications, fixing 'make check'
By far the most common kind of update is to replace Gtk::Container::
set_border_width() with Gtk::Widget::property_margin().
Other common updates: Remove explicit template parameters from calls to
sigc::bind(). Use sigc::signal<R(Args...)> syntax.
examples/book/alignment/examplewindow.cc | 4 +--
.../app_and_win_menus/exampleapplication.cc | 2 +-
.../command_line_handling/exampleapplication.cc | 2 +-
.../book/application/simple/exampleapplication.cc | 2 +-
examples/book/aspectframe/examplewindow.cc | 4 +--
examples/book/assistant/exampleassistant.cc | 1 -
examples/book/assistant/examplewindow.cc | 3 +-
examples/book/buttonbox/examplebuttonbox.cc | 19 ++++++++---------
examples/book/buttonbox/examplewindow.cc | 9 +++----
examples/book/buttons/button/buttons.cc | 4 +--
examples/book/buttons/checkbutton/examplewindow.cc | 4 +--
.../buttons/filechooserbutton/examplewindow.cc | 4 +--
examples/book/buttons/radiobutton/radiobuttons.cc | 7 ++---
examples/book/buttons/scalebutton/examplewindow.cc | 4 +--
.../book/buttons/togglebutton/examplewindow.cc | 4 +--
.../book/buttons/volumebutton/examplewindow.cc | 4 +--
examples/book/clipboard/ideal/examplewindow.cc | 4 +--
examples/book/clipboard/simple/examplewindow.cc | 4 +--
examples/book/eventbox/examplewindow.cc | 4 +--
examples/book/expander/examplewindow.cc | 6 +---
examples/book/flowbox/examplewindow.cc | 2 +-
examples/book/frame/examplewindow.cc | 6 +---
examples/book/grid/examplewindow.cc | 8 ++----
examples/book/headerbar/examplewindow.cc | 2 +-
examples/book/helloworld/helloworld.cc | 6 +---
examples/book/helloworld/helloworld.h | 4 +--
examples/book/helloworld2/helloworld.cc | 14 +++++-------
examples/book/helloworld2/helloworld.h | 8 ++----
examples/book/iconview/examplewindow.cc | 21 ++++++++++++++-----
examples/book/idle/idleexample.cc | 4 +--
examples/book/infobar/examplewindow.cc | 2 +-
.../keyboard_events/propagation/examplewindow.cc | 4 +-
.../book/keyboard_events/simple/examplewindow.cc | 2 +-
examples/book/label/examplewindow.cc | 4 +--
examples/book/listbox/examplewindow.cc | 2 +-
examples/book/listmodel/examplewindow.cc | 2 +-
.../book/menus/main_menu/exampleapplication.cc | 2 +-
examples/book/multithread/examplewindow.cc | 4 +-
examples/book/notebook/examplewindow.cc | 7 +----
examples/book/paned/examplewindow.cc | 4 +--
examples/book/placessidebar/examplewindow.cc | 6 +++-
examples/book/popover/examplewindow.cc | 6 ++--
examples/book/printing/advanced/previewdialog.cc | 2 +-
.../book/printing/advanced/printformoperation.cc | 4 +-
examples/book/progressbar/examplewindow.cc | 2 +-
examples/book/range_widgets/examplewindow.cc | 6 +---
examples/book/revealer/examplewindow.cc | 2 +-
examples/book/scrolledwindow/examplewindow.cc | 5 +---
examples/book/searchbar/examplewindow.cc | 2 +-
examples/book/spinbutton/examplewindow.cc | 8 ++----
examples/book/textview/examplewindow.cc | 6 +---
examples/book/timeout/timerexample.cc | 7 +----
examples/book/toolbar/examplewindow.cc | 4 +--
examples/book/toolpalette/canvas.cc | 1 -
examples/book/toolpalette/examplewindow.cc | 8 ++----
examples/book/tooltips/examplewindow.cc | 4 +--
.../book/treeview/combo_renderer/examplewindow.cc | 6 +---
.../book/treeview/drag_and_drop/examplewindow.cc | 6 +---
.../book/treeview/editable_cells/examplewindow.cc | 5 +--
examples/book/treeview/filter/examplewindow.cc | 6 +---
.../book/treeview/filter_modify/examplewindow.cc | 6 +---
examples/book/treeview/list/examplewindow.cc | 6 +---
.../book/treeview/listviewtext/examplewindow.cc | 6 +---
examples/book/treeview/modelsort/examplewindow.cc | 6 +---
examples/book/treeview/popup/examplewindow.cc | 6 +---
examples/book/treeview/tree/examplewindow.cc | 6 +---
examples/book/update_ui/examplewindow.cc | 7 +----
examples/others/arrow/arrow.cc | 7 ++---
examples/others/calendar/calendar.cc | 3 +-
.../others/cellrenderercustom/cellrendererpopup.cc | 18 ++++++++++------
.../others/cellrenderercustom/cellrendererpopup.h | 12 ++++------
.../cellrenderercustom/cellrenderertoggle.cc | 4 +-
examples/others/cellrenderercustom/popupentry.h | 4 +--
examples/others/exception/exceptiontest.cc | 2 +-
examples/others/idle/idle.cc | 4 +-
examples/others/tictactoe/tictactoe.h | 2 +-
examples/others/tictactoe/ttt_test.cc | 2 +-
examples/others/treemodelcustom/examplewindow.cc | 7 +----
78 files changed, 162 insertions(+), 245 deletions(-)
---
diff --git a/examples/book/alignment/examplewindow.cc b/examples/book/alignment/examplewindow.cc
index 2eee464..a545fa9 100644
--- a/examples/book/alignment/examplewindow.cc
+++ b/examples/book/alignment/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -22,9 +20,9 @@ ExampleWindow::ExampleWindow()
: m_Button("_Close", /* mnemonic= */ true)
{
set_title("Alignment");
- set_border_width(10);
set_default_size(200, 50);
+ m_Button.property_margin() = 10;
m_Button.set_halign(Gtk::ALIGN_END);
m_Button.set_valign(Gtk::ALIGN_CENTER);
add(m_Button);
diff --git a/examples/book/application/app_and_win_menus/exampleapplication.cc
b/examples/book/application/app_and_win_menus/exampleapplication.cc
index 9fe8268..1dee64a 100644
--- a/examples/book/application/app_and_win_menus/exampleapplication.cc
+++ b/examples/book/application/app_and_win_menus/exampleapplication.cc
@@ -95,7 +95,7 @@ void ExampleApplication::create_window()
//Delete the window when it is hidden.
//That's enough for this simple example.
- window->signal_hide().connect(sigc::bind<Gtk::Window*>(sigc::mem_fun(*this,
+ window->signal_hide().connect(sigc::bind(sigc::mem_fun(*this,
&ExampleApplication::on_window_hide), window));
window->show();
diff --git a/examples/book/application/command_line_handling/exampleapplication.cc
b/examples/book/application/command_line_handling/exampleapplication.cc
index 189c007..d9f988d 100644
--- a/examples/book/application/command_line_handling/exampleapplication.cc
+++ b/examples/book/application/command_line_handling/exampleapplication.cc
@@ -69,7 +69,7 @@ void ExampleApplication::create_window(const Glib::RefPtr<Gio::File>& file)
//Delete the window when it is hidden.
//That's enough for this simple example.
- window->signal_hide().connect(sigc::bind<Gtk::Window*>(sigc::mem_fun(*this,
+ window->signal_hide().connect(sigc::bind(sigc::mem_fun(*this,
&ExampleApplication::on_window_hide), window));
window->show();
diff --git a/examples/book/application/simple/exampleapplication.cc
b/examples/book/application/simple/exampleapplication.cc
index 6428fb0..8853a5e 100644
--- a/examples/book/application/simple/exampleapplication.cc
+++ b/examples/book/application/simple/exampleapplication.cc
@@ -38,7 +38,7 @@ void ExampleApplication::create_window(const Glib::RefPtr<Gio::File>& file)
//Delete the window when it is hidden.
//That's enough for this simple example.
- window->signal_hide().connect(sigc::bind<Gtk::Window*>(sigc::mem_fun(*this,
+ window->signal_hide().connect(sigc::bind(sigc::mem_fun(*this,
&ExampleApplication::on_window_hide), window));
window->show();
diff --git a/examples/book/aspectframe/examplewindow.cc b/examples/book/aspectframe/examplewindow.cc
index 8d9a69e..44659d4 100644
--- a/examples/book/aspectframe/examplewindow.cc
+++ b/examples/book/aspectframe/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -26,13 +24,13 @@ ExampleWindow::ExampleWindow()
false /* ignore child's aspect */)
{
set_title("Aspect Frame");
- set_border_width(10);
// Add a child widget to the aspect frame */
// Ask for a 200x200 window, but the AspectFrame will give us a 200x100
// window since we are forcing a 2x1 aspect ratio */
m_DrawingArea.set_size_request(200, 200);
m_AspectFrame.add(m_DrawingArea);
+ m_AspectFrame.property_margin() = 10;
// Add the aspect frame to our toplevel window:
add(m_AspectFrame);
diff --git a/examples/book/assistant/exampleassistant.cc b/examples/book/assistant/exampleassistant.cc
index a3e22a1..54836a1 100644
--- a/examples/book/assistant/exampleassistant.cc
+++ b/examples/book/assistant/exampleassistant.cc
@@ -24,7 +24,6 @@ ExampleAssistant::ExampleAssistant()
m_check("Optional extra information")
{
set_title("Gtk::Assistant example");
- set_border_width(12);
set_default_size(400, 300);
m_box.pack_start(m_label1);
diff --git a/examples/book/assistant/examplewindow.cc b/examples/book/assistant/examplewindow.cc
index 3b879e7..9ceb01e 100644
--- a/examples/book/assistant/examplewindow.cc
+++ b/examples/book/assistant/examplewindow.cc
@@ -23,9 +23,10 @@ ExampleWindow::ExampleWindow()
m_label2("Contents of assistant entry:", Gtk::ALIGN_START, Gtk::ALIGN_CENTER)
{
set_title("Gtk::Assistant example");
- set_border_width(12);
m_grid.set_row_homogeneous(true);
+ m_grid.set_column_spacing(5);
+ m_grid.property_margin() = 12;
m_grid.attach(m_button, 0, 0, 2, 1);
m_button.set_hexpand(true);
diff --git a/examples/book/buttonbox/examplebuttonbox.cc b/examples/book/buttonbox/examplebuttonbox.cc
index 0374c10..40f10cd 100644
--- a/examples/book/buttonbox/examplebuttonbox.cc
+++ b/examples/book/buttonbox/examplebuttonbox.cc
@@ -1,5 +1,3 @@
-//$Id: examplebuttonbox.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -27,14 +25,15 @@ ExampleButtonBox::ExampleButtonBox(bool horizontal,
m_Button_Cancel("Cancel"),
m_Button_Help("Help")
{
- Gtk::ButtonBox* bbox = nullptr;
-
- if(horizontal)
- bbox = Gtk::manage( new Gtk::ButtonBox(Gtk::ORIENTATION_HORIZONTAL) );
- else
- bbox = Gtk::manage( new Gtk::ButtonBox(Gtk::ORIENTATION_VERTICAL) );
-
- bbox->set_border_width(5);
+ auto orientation = horizontal ? Gtk::ORIENTATION_HORIZONTAL : Gtk::ORIENTATION_VERTICAL;
+ auto bbox = Gtk::manage(new Gtk::ButtonBox(orientation));
+
+ if (!horizontal)
+ {
+ set_margin_start(5);
+ set_margin_end(5);
+ }
+ bbox->property_margin() = 5;
add(*bbox);
diff --git a/examples/book/buttonbox/examplewindow.cc b/examples/book/buttonbox/examplewindow.cc
index d18a37d..81a4404 100644
--- a/examples/book/buttonbox/examplewindow.cc
+++ b/examples/book/buttonbox/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -26,12 +24,13 @@ ExampleWindow::ExampleWindow()
m_Frame_Vertical("Vertical Button Boxes")
{
set_title("Gtk::ButtonBox");
+ m_VBox_Main.property_margin() = 10;
add(m_VBox_Main);
m_VBox_Main.pack_start(m_Frame_Horizontal, Gtk::PACK_EXPAND_WIDGET, 10);
//The horizontal ButtonBoxes:
- m_VBox.set_border_width(10);
+ m_VBox.property_margin() = 10;
m_Frame_Horizontal.add(m_VBox);
m_VBox.pack_start(*Gtk::manage(
@@ -50,7 +49,7 @@ ExampleWindow::ExampleWindow()
Gtk::PACK_EXPAND_WIDGET, 5);
m_VBox.pack_start(*Gtk::manage(
- new ExampleButtonBox(true, "end (spacing 10)", 10,
+ new ExampleButtonBox(true, "End (spacing 10)", 10,
Gtk::BUTTONBOX_END)),
Gtk::PACK_EXPAND_WIDGET, 5);
@@ -58,7 +57,7 @@ ExampleWindow::ExampleWindow()
//The vertical ButtonBoxes:
m_VBox_Main.pack_start(m_Frame_Vertical, Gtk::PACK_EXPAND_WIDGET, 10);
- m_HBox.set_border_width(10);
+ m_HBox.property_margin() = 10;
m_Frame_Vertical.add(m_HBox);
m_HBox.pack_start(*Gtk::manage(
diff --git a/examples/book/buttons/button/buttons.cc b/examples/book/buttons/button/buttons.cc
index 21d9d96..e2b5106 100644
--- a/examples/book/buttons/button/buttons.cc
+++ b/examples/book/buttons/button/buttons.cc
@@ -1,5 +1,3 @@
-//$Id: buttons.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,11 +22,11 @@ Buttons::Buttons()
m_button.add_pixlabel("info.xpm", "cool button");
set_title("Pixmap'd buttons!");
- set_border_width(10);
m_button.signal_clicked().connect( sigc::mem_fun(*this,
&Buttons::on_button_clicked) );
+ m_button.property_margin() = 10;
add(m_button);
show_all_children();
diff --git a/examples/book/buttons/checkbutton/examplewindow.cc
b/examples/book/buttons/checkbutton/examplewindow.cc
index bcaaf96..c940cc6 100644
--- a/examples/book/buttons/checkbutton/examplewindow.cc
+++ b/examples/book/buttons/checkbutton/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -23,11 +21,11 @@ ExampleWindow::ExampleWindow()
: m_button("something")
{
set_title("checkbutton example");
- set_border_width(10);
m_button.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_clicked) );
+ m_button.property_margin() = 10;
add(m_button);
show_all_children();
diff --git a/examples/book/buttons/filechooserbutton/examplewindow.cc
b/examples/book/buttons/filechooserbutton/examplewindow.cc
index 881f3a3..53c06f3 100644
--- a/examples/book/buttons/filechooserbutton/examplewindow.cc
+++ b/examples/book/buttons/filechooserbutton/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -25,8 +23,8 @@ ExampleWindow::ExampleWindow()
set_default_size(200, -1);
set_title("FileChooserButton example");
- set_border_width(10);
+ m_button.property_margin() = 10;
add(m_button);
//Allow our file chooser to select remote URIs,
diff --git a/examples/book/buttons/radiobutton/radiobuttons.cc
b/examples/book/buttons/radiobutton/radiobuttons.cc
index 227d998..5976890 100644
--- a/examples/book/buttons/radiobutton/radiobuttons.cc
+++ b/examples/book/buttons/radiobutton/radiobuttons.cc
@@ -28,7 +28,6 @@ RadioButtons::RadioButtons() :
{
// Set title and border of the window
set_title("radio buttons");
- set_border_width(0);
// Put radio buttons 2 and 3 in the same group as 1:
m_RadioButton2.join_group(m_RadioButton1);
@@ -43,9 +42,9 @@ RadioButtons::RadioButtons() :
m_Box_Top.pack_start(m_Separator);
m_Box_Top.pack_start(m_Box2);
- // Set the inner boxes' borders
- m_Box2.set_border_width(10);
- m_Box1.set_border_width(10);
+ // Set the inner boxes' margins
+ m_Box1.property_margin() = 10;
+ m_Box2.property_margin() = 10;
// Put the radio buttons in Box1:
m_Box1.pack_start(m_RadioButton1);
diff --git a/examples/book/buttons/scalebutton/examplewindow.cc
b/examples/book/buttons/scalebutton/examplewindow.cc
index 911db56..1754e62 100644
--- a/examples/book/buttons/scalebutton/examplewindow.cc
+++ b/examples/book/buttons/scalebutton/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: buttons.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -27,7 +25,6 @@ ExampleWindow::ExampleWindow()
set_default_size(300, 300);
set_title("ScaleButton Example");
- set_border_width(12);
std::vector<Glib::ustring> icons;
icons.push_back("audio-volume-low");
@@ -35,6 +32,7 @@ ExampleWindow::ExampleWindow()
icons.push_back("audio-volume-medium");
m_button.set_icons(icons);
+ m_grid.property_margin() = 12;
add(m_grid);
m_grid.set_vexpand(true);
m_grid.set_hexpand(true);
diff --git a/examples/book/buttons/togglebutton/examplewindow.cc
b/examples/book/buttons/togglebutton/examplewindow.cc
index 7a20478..7ffbf94 100644
--- a/examples/book/buttons/togglebutton/examplewindow.cc
+++ b/examples/book/buttons/togglebutton/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -23,11 +21,11 @@ ExampleWindow::ExampleWindow()
: m_button("something")
{
set_title("togglebutton example");
- set_border_width(10);
m_button.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_clicked) );
+ m_button.property_margin() = 10;
add(m_button);
show_all_children();
diff --git a/examples/book/buttons/volumebutton/examplewindow.cc
b/examples/book/buttons/volumebutton/examplewindow.cc
index 189052b..0107eae 100644
--- a/examples/book/buttons/volumebutton/examplewindow.cc
+++ b/examples/book/buttons/volumebutton/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: buttons.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -26,8 +24,8 @@ ExampleWindow::ExampleWindow()
set_default_size(300, 300);
set_title("VolumeButton Example");
- set_border_width(12);
+ m_grid.property_margin() = 12;
add(m_grid);
m_button.set_vexpand(true);
m_button.set_hexpand(true);
diff --git a/examples/book/clipboard/ideal/examplewindow.cc b/examples/book/clipboard/ideal/examplewindow.cc
index 6441a8c..dab5f39 100644
--- a/examples/book/clipboard/ideal/examplewindow.cc
+++ b/examples/book/clipboard/ideal/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -38,8 +36,8 @@ ExampleWindow::ExampleWindow()
m_Button_Copy("_Copy", /* mnemonic= */ true), m_Button_Paste("_Paste", true)
{
set_title("Gtk::Clipboard example");
- set_border_width(12);
+ m_VBox.property_margin() = 12;
add(m_VBox);
m_VBox.pack_start(m_Label, Gtk::PACK_SHRINK);
diff --git a/examples/book/clipboard/simple/examplewindow.cc b/examples/book/clipboard/simple/examplewindow.cc
index fdd1399..f72f24f 100644
--- a/examples/book/clipboard/simple/examplewindow.cc
+++ b/examples/book/clipboard/simple/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -26,8 +24,8 @@ ExampleWindow::ExampleWindow()
m_Button_Copy("_Copy", /* mnemonic= */ true), m_Button_Paste("_Paste", true)
{
set_title("Gtk::Clipboard example");
- set_border_width(12);
+ m_VBox.property_margin() = 12;
add(m_VBox);
m_VBox.pack_start(m_Label, Gtk::PACK_SHRINK);
diff --git a/examples/book/eventbox/examplewindow.cc b/examples/book/eventbox/examplewindow.cc
index 6ff0270..38b9c47 100644
--- a/examples/book/eventbox/examplewindow.cc
+++ b/examples/book/eventbox/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 870 2007-07-13 19:08:46Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -22,8 +20,8 @@ ExampleWindow::ExampleWindow()
: m_Label("Click here to quit, quit, quit, quit, quit")
{
set_title ("EventBox");
- set_border_width(10);
+ m_EventBox.property_margin() = 10;
add(m_EventBox);
m_EventBox.add(m_Label);
diff --git a/examples/book/expander/examplewindow.cc b/examples/book/expander/examplewindow.cc
index a429b61..d8d4136 100644
--- a/examples/book/expander/examplewindow.cc
+++ b/examples/book/expander/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,8 +22,8 @@ ExampleWindow::ExampleWindow()
/* Set some window properties */
set_title("Expander Example");
- /* Sets the border width of the window. */
- set_border_width(6);
+ /* Sets the margin around the expander. */
+ m_Expander.property_margin() = 6;
add(m_Expander);
m_Expander.add(m_Label);
diff --git a/examples/book/flowbox/examplewindow.cc b/examples/book/flowbox/examplewindow.cc
index 3134705..84bc80a 100644
--- a/examples/book/flowbox/examplewindow.cc
+++ b/examples/book/flowbox/examplewindow.cc
@@ -21,7 +21,6 @@ ExampleWindow::ExampleWindow()
// Window properties
set_title("FlowBox Example");
set_default_size(600, 400);
- set_border_width(6);
// Scrolled window
m_scrolled_window.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
@@ -41,6 +40,7 @@ ExampleWindow::ExampleWindow()
// Layout
m_scrolled_window.add(m_flow_box);
+ m_scrolled_window.property_margin() = 6;
add(m_scrolled_window);
show_all_children();
diff --git a/examples/book/frame/examplewindow.cc b/examples/book/frame/examplewindow.cc
index 2a8406b..9b39f6e 100644
--- a/examples/book/frame/examplewindow.cc
+++ b/examples/book/frame/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,8 +22,8 @@ ExampleWindow::ExampleWindow()
set_title("Frame Example");
set_size_request(300, 300);
- /* Sets the border width of the window. */
- set_border_width(10);
+ /* Sets the margin around the frame. */
+ m_Frame.property_margin() = 10;
add(m_Frame);
diff --git a/examples/book/grid/examplewindow.cc b/examples/book/grid/examplewindow.cc
index 068dd83..aaf60f5 100644
--- a/examples/book/grid/examplewindow.cc
+++ b/examples/book/grid/examplewindow.cc
@@ -24,8 +24,8 @@ ExampleWindow::ExampleWindow()
m_button_quit("Quit")
{
set_title("Gtk::Grid");
- set_border_width(12);
+ m_grid.property_margin() = 12;
add(m_grid);
m_grid.add(m_button_1);
@@ -33,11 +33,9 @@ ExampleWindow::ExampleWindow()
m_grid.attach_next_to(m_button_quit, m_button_1, Gtk::POS_BOTTOM, 2, 1);
m_button_1.signal_clicked().connect(
- sigc::bind<Glib::ustring>( sigc::mem_fun(*this,
- &ExampleWindow::on_button_numbered), "button 1") );
+ sigc::bind( sigc::mem_fun(*this, &ExampleWindow::on_button_numbered), "button 1") );
m_button_2.signal_clicked().connect(
- sigc::bind<Glib::ustring>( sigc::mem_fun(*this,
- &ExampleWindow::on_button_numbered), "button 2") );
+ sigc::bind( sigc::mem_fun(*this, &ExampleWindow::on_button_numbered), "button 2") );
m_button_quit.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/headerbar/examplewindow.cc b/examples/book/headerbar/examplewindow.cc
index 405104f..1551feb 100644
--- a/examples/book/headerbar/examplewindow.cc
+++ b/examples/book/headerbar/examplewindow.cc
@@ -23,7 +23,6 @@ ExampleWindow::ExampleWindow()
{
// Window properties
set_title("HeaderBar Example");
- set_border_width(12);
// Button
m_button.set_image_from_icon_name("go-home-symbolic", Gtk::ICON_SIZE_BUTTON, true);
@@ -57,6 +56,7 @@ ExampleWindow::ExampleWindow()
m_grid.attach(m_title_entry, 1, 1, 1, 1);
m_grid.attach(m_subtitle_label, 0, 2, 1, 1);
m_grid.attach(m_subtitle_entry, 1, 2, 1, 1);
+ m_grid.property_margin() = 12;
add(m_grid);
show_all_children();
diff --git a/examples/book/helloworld/helloworld.cc b/examples/book/helloworld/helloworld.cc
index b97bb7d..2f695ff 100644
--- a/examples/book/helloworld/helloworld.cc
+++ b/examples/book/helloworld/helloworld.cc
@@ -1,5 +1,3 @@
-//$Id: helloworld.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -22,8 +20,8 @@
HelloWorld::HelloWorld()
: m_button("Hello World") // creates a new button with label "Hello World".
{
- // Sets the border width of the window.
- set_border_width(10);
+ // Sets the margin around the button.
+ m_button.property_margin() = 10;
// When the button receives the "clicked" signal, it will call the
// on_button_clicked() method defined below.
diff --git a/examples/book/helloworld/helloworld.h b/examples/book/helloworld/helloworld.h
index 8fb825e..acf6429 100644
--- a/examples/book/helloworld/helloworld.h
+++ b/examples/book/helloworld/helloworld.h
@@ -1,5 +1,3 @@
-//$Id: helloworld.h 2 2003-01-21 13:41:59Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -27,7 +25,7 @@ class HelloWorld : public Gtk::Window
public:
HelloWorld();
- virtual ~HelloWorld();
+ ~HelloWorld() override;
protected:
//Signal handlers:
diff --git a/examples/book/helloworld2/helloworld.cc b/examples/book/helloworld2/helloworld.cc
index 977fdcd..63827b6 100644
--- a/examples/book/helloworld2/helloworld.cc
+++ b/examples/book/helloworld2/helloworld.cc
@@ -1,5 +1,3 @@
-//$Id: helloworld.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -26,15 +24,15 @@ HelloWorld::HelloWorld()
// This just sets the title of our new window.
set_title("Hello Buttons!");
- // sets the border width of the window.
- set_border_width(10);
+ // Sets the margin around the box.
+ m_box1.property_margin() = 10;
// put the box into the main window.
add(m_box1);
// Now when the button is clicked, we call the "on_button_clicked" function
- // with a pointer to "button 1" as it's argument
- m_button1.signal_clicked().connect(sigc::bind<Glib::ustring>(
+ // with a pointer to "button 1" as its argument
+ m_button1.signal_clicked().connect(sigc::bind(
sigc::mem_fun(*this, &HelloWorld::on_button_clicked), "button 1"));
// instead of gtk_container_add, we pack this button into the invisible
@@ -48,7 +46,7 @@ HelloWorld::HelloWorld()
// call the same signal handler with a different argument,
// passing a pointer to "button 2" instead.
- m_button2.signal_clicked().connect(sigc::bind<-1, Glib::ustring>(
+ m_button2.signal_clicked().connect(sigc::bind(
sigc::mem_fun(*this, &HelloWorld::on_button_clicked), "button 2"));
m_box1.pack_start(m_button2);
@@ -65,7 +63,7 @@ HelloWorld::~HelloWorld()
// Our new improved signal handler. The data passed to this method is
// printed to stdout.
-void HelloWorld::on_button_clicked(Glib::ustring data)
+void HelloWorld::on_button_clicked(const Glib::ustring& data)
{
std::cout << "Hello World - " << data << " was pressed" << std::endl;
}
diff --git a/examples/book/helloworld2/helloworld.h b/examples/book/helloworld2/helloworld.h
index 4532198..bf39cd6 100644
--- a/examples/book/helloworld2/helloworld.h
+++ b/examples/book/helloworld2/helloworld.h
@@ -1,5 +1,3 @@
-//$Id: helloworld.h 2 2003-01-21 13:41:59Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -27,13 +25,13 @@ class HelloWorld : public Gtk::Window
{
public:
HelloWorld();
- virtual ~HelloWorld();
+ ~HelloWorld() override;
protected:
// Signal handlers:
- // Our new improved on_button_clicked(). (see below)
- void on_button_clicked(Glib::ustring data);
+ // Our new improved on_button_clicked().
+ void on_button_clicked(const Glib::ustring& data);
// Child widgets:
Gtk::Box m_box1;
diff --git a/examples/book/iconview/examplewindow.cc b/examples/book/iconview/examplewindow.cc
index a8f54f4..7c3070c 100644
--- a/examples/book/iconview/examplewindow.cc
+++ b/examples/book/iconview/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2006 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -43,10 +41,10 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::IconView (ListStore + TreeModelSort) example");
- set_border_width(5);
set_default_size(400, 400);
- add( m_VBox );
+ m_VBox.property_margin() = 5;
+ add(m_VBox);
// Add the TreeView inside a ScrolledWindow, with the button underneath:
m_ScrolledWindow.add(m_IconView);
@@ -58,7 +56,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(6);
+ m_ButtonBox.property_margin() = 6;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
@@ -153,7 +151,18 @@ void ExampleWindow::add_entry(const std::string& filename,
row[m_Columns.m_col_filename] = filename;
row[m_Columns.m_col_description] = description;
- row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(filename);
+ try
+ {
+ row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(filename);
+ }
+ catch (const Gdk::PixbufError& ex)
+ {
+ std::cerr << "Gdk::PixbufError: " << ex.what() << std::endl;
+ }
+ catch (const Glib::FileError& ex)
+ {
+ std::cerr << "Glib::FileError: " << ex.what() << std::endl;
+ }
}
diff --git a/examples/book/idle/idleexample.cc b/examples/book/idle/idleexample.cc
index f08fb8c..930ae16 100644
--- a/examples/book/idle/idleexample.cc
+++ b/examples/book/idle/idleexample.cc
@@ -1,5 +1,3 @@
-//$Id: idleexample.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2003 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -22,7 +20,7 @@ IdleExample::IdleExample() :
m_Box(Gtk::ORIENTATION_VERTICAL, 5),
m_ButtonQuit("_Quit", true)
{
- set_border_width(5);
+ m_Box.property_margin() = 5;
// Put buttons into container
diff --git a/examples/book/infobar/examplewindow.cc b/examples/book/infobar/examplewindow.cc
index 1a29933..1988220 100644
--- a/examples/book/infobar/examplewindow.cc
+++ b/examples/book/infobar/examplewindow.cc
@@ -22,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Clear("_Clear", true)
{
set_title("Gtk::InfoBar example");
- set_border_width(6);
set_default_size(400, 200);
+ m_VBox.property_margin() = 6;
add(m_VBox);
// Add the message label to the InfoBar:
diff --git a/examples/book/keyboard_events/propagation/examplewindow.cc
b/examples/book/keyboard_events/propagation/examplewindow.cc
index 0980799..f8864db 100644
--- a/examples/book/keyboard_events/propagation/examplewindow.cc
+++ b/examples/book/keyboard_events/propagation/examplewindow.cc
@@ -19,9 +19,9 @@
ExampleWindow::ExampleWindow()
{
- add(m_container);
set_title("Event Propagation");
- set_border_width(10);
+ m_container.property_margin() = 10;
+ add(m_container);
m_label.set_label("A label");
m_checkbutton_can_propagate.set_label("Can Propagate");
diff --git a/examples/book/keyboard_events/simple/examplewindow.cc
b/examples/book/keyboard_events/simple/examplewindow.cc
index c8528ee..11f6a98 100644
--- a/examples/book/keyboard_events/simple/examplewindow.cc
+++ b/examples/book/keyboard_events/simple/examplewindow.cc
@@ -19,7 +19,7 @@
ExampleWindow::ExampleWindow()
{
set_title("Keyboard Events");
- set_border_width(10);
+ m_container.property_margin() = 10;
add(m_container);
// Radio buttons:
diff --git a/examples/book/label/examplewindow.cc b/examples/book/label/examplewindow.cc
index a1e7e4f..c09ed68 100644
--- a/examples/book/label/examplewindow.cc
+++ b/examples/book/label/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -39,8 +37,8 @@ ExampleWindow::ExampleWindow()
"This one is underlined in quite a funky fashion")
{
set_title("Label");
- set_border_width(5);
+ m_HBox.property_margin() = 5;
add(m_HBox);
m_HBox.pack_start(m_VBox, Gtk::PACK_SHRINK);
diff --git a/examples/book/listbox/examplewindow.cc b/examples/book/listbox/examplewindow.cc
index b16d01e..5c3af29 100644
--- a/examples/book/listbox/examplewindow.cc
+++ b/examples/book/listbox/examplewindow.cc
@@ -60,9 +60,9 @@ ExampleWindow::ExampleWindow() :
m_Button_Visibility("visibility")
{
set_title("ListBox example");
- set_border_width(5);
set_default_size(300, 300);
+ m_HBox.property_margin() = 5;
add(m_HBox);
m_HBox.pack_start(m_VBox1, Gtk::PACK_SHRINK);
diff --git a/examples/book/listmodel/examplewindow.cc b/examples/book/listmodel/examplewindow.cc
index ac6b747..095485d 100644
--- a/examples/book/listmodel/examplewindow.cc
+++ b/examples/book/listmodel/examplewindow.cc
@@ -27,7 +27,6 @@ m_button_remove_some("_Remove some", true),
m_button_quit("_Quit", true)
{
set_title("ListBox and FlowBox with ListModel");
- set_border_width(5);
set_default_size(300, 300);
for (int i = 0; i < 20; ++i)
@@ -39,6 +38,7 @@ m_button_quit("_Quit", true)
// Use current time as seed for random number generator.
std::srand(std::time(nullptr));
+ m_grid.property_margin() = 5;
add(m_grid);
// Select bind_model() or bind_list_store() randomly.
diff --git a/examples/book/menus/main_menu/exampleapplication.cc
b/examples/book/menus/main_menu/exampleapplication.cc
index 3aaef6b..f4054a2 100644
--- a/examples/book/menus/main_menu/exampleapplication.cc
+++ b/examples/book/menus/main_menu/exampleapplication.cc
@@ -231,7 +231,7 @@ void ExampleApplication::create_window()
//Delete the window when it is hidden.
//That's enough for this simple example.
- win->signal_hide().connect(sigc::bind<Gtk::Window*>(
+ win->signal_hide().connect(sigc::bind(
sigc::mem_fun(*this, &ExampleApplication::on_window_hide), win));
win->show_all();
diff --git a/examples/book/multithread/examplewindow.cc b/examples/book/multithread/examplewindow.cc
index 7d0f98a..c37387e 100644
--- a/examples/book/multithread/examplewindow.cc
+++ b/examples/book/multithread/examplewindow.cc
@@ -30,9 +30,9 @@ ExampleWindow::ExampleWindow() :
m_WorkerThread(nullptr)
{
set_title("Multi-threaded example");
- set_border_width(5);
set_default_size(300, 300);
+ m_VBox.property_margin() = 5;
add(m_VBox);
// Add the ProgressBar.
@@ -57,7 +57,7 @@ ExampleWindow::ExampleWindow() :
m_ButtonBox.pack_start(m_ButtonStart, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_ButtonStop, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_ButtonQuit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_spacing(5);
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
diff --git a/examples/book/notebook/examplewindow.cc b/examples/book/notebook/examplewindow.cc
index 7fe8a36..38b37aa 100644
--- a/examples/book/notebook/examplewindow.cc
+++ b/examples/book/notebook/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -26,14 +24,13 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::Notebook example");
- set_border_width(10);
set_default_size(400, 200);
-
+ m_VBox.property_margin() = 10;
add(m_VBox);
//Add the Notebook, with the button underneath:
- m_Notebook.set_border_width(10);
+ m_Notebook.property_margin() = 10;
m_VBox.pack_start(m_Notebook);
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
diff --git a/examples/book/paned/examplewindow.cc b/examples/book/paned/examplewindow.cc
index 4fb3fdf..06fa545 100644
--- a/examples/book/paned/examplewindow.cc
+++ b/examples/book/paned/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -22,8 +20,8 @@ ExampleWindow::ExampleWindow()
: m_VPaned(Gtk::ORIENTATION_VERTICAL)
{
set_title ("Paned Windows");
- set_border_width(10);
set_default_size(450, 400);
+ m_VPaned.property_margin() = 10;
/* Add a vpaned widget to our toplevel window */
add(m_VPaned);
diff --git a/examples/book/placessidebar/examplewindow.cc b/examples/book/placessidebar/examplewindow.cc
index a697f42..8677c5e 100644
--- a/examples/book/placessidebar/examplewindow.cc
+++ b/examples/book/placessidebar/examplewindow.cc
@@ -23,7 +23,6 @@ ExampleWindow::ExampleWindow()
{
// Window properties
set_title("PlacesSidebar Example");
- set_border_width(12);
set_size_request(500, 600);
// Options
@@ -58,6 +57,7 @@ ExampleWindow::ExampleWindow()
m_controls_frame.add(m_controls);
m_hbox.pack_start(m_places_sidebar, Gtk::PACK_EXPAND_WIDGET);
m_hbox.pack_start(m_controls_frame, Gtk::PACK_SHRINK);
+ m_hbox.property_margin() = 12;
add(m_hbox);
show_all_children();
@@ -108,8 +108,10 @@ void ExampleWindow::on_placessidebar_open_location(const Glib::RefPtr<Gio::File>
location_information_grid.attach(file_uri_label, 1, 2, 1, 1);
location_information_grid.set_column_spacing(6);
+ location_information_grid.set_margin_start(6);
+ location_information_grid.set_margin_end(6);
- dialog.get_content_area()->pack_end(location_information_grid, true, true, 6);
+ dialog.get_content_area()->pack_end(location_information_grid, true, true);
dialog.show_all();
dialog.run();
}
diff --git a/examples/book/popover/examplewindow.cc b/examples/book/popover/examplewindow.cc
index 9cb0591..2792c90 100644
--- a/examples/book/popover/examplewindow.cc
+++ b/examples/book/popover/examplewindow.cc
@@ -27,7 +27,6 @@ ExampleWindow::ExampleWindow()
{
// Window properties
set_title("Popover Example");
- set_border_width(12);
set_default_size(500, -1);
// Button
@@ -47,6 +46,7 @@ ExampleWindow::ExampleWindow()
m_grid.set_row_spacing(6);
m_grid.attach(m_toggle_button, 0, 0, 1, 1);
m_grid.attach(m_calendar, 0, 1, 6, 1);
+ m_grid.property_margin() = 12;
add(m_grid);
show_all_children();
@@ -77,7 +77,7 @@ void ExampleWindow::configure_form_popover()
m_toggle_form_popover.add(m_toggle_form_grid);
m_toggle_form_popover.set_position(Gtk::POS_BOTTOM);
- m_toggle_form_popover.set_border_width(6);
+ m_toggle_form_popover.property_margin() = 6;
m_toggle_form_popover.set_modal(false);
}
@@ -140,7 +140,7 @@ void ExampleWindow::configure_cal_popover()
m_calendar_form_grid.show_all();
m_calendar_popover.add(m_calendar_form_grid);
- m_calendar_popover.set_border_width(6);
+ m_calendar_popover.property_margin() = 6;
}
void ExampleWindow::on_day_selected()
diff --git a/examples/book/printing/advanced/previewdialog.cc
b/examples/book/printing/advanced/previewdialog.cc
index 77d2928..70aacb6 100644
--- a/examples/book/printing/advanced/previewdialog.cc
+++ b/examples/book/printing/advanced/previewdialog.cc
@@ -37,8 +37,8 @@ PreviewDialog::PreviewDialog(
{
set_transient_for(parent);
set_title("Preview");
- set_border_width(2);
+ m_VBox.property_margin() = 2;
add(m_VBox);
m_HBox.pack_start(m_PageSpin);
diff --git a/examples/book/printing/advanced/printformoperation.cc
b/examples/book/printing/advanced/printformoperation.cc
index 42096f1..3a5c621 100644
--- a/examples/book/printing/advanced/printformoperation.cc
+++ b/examples/book/printing/advanced/printformoperation.cc
@@ -155,11 +155,11 @@ Gtk::Widget* PrintFormOperation::on_create_custom_widget()
set_custom_tab_label("Other");
auto vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
- vbox->set_border_width(12);
+ vbox->property_margin() = 12;
auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 8));
vbox->pack_start(*hbox, false, false);
- hbox->set_border_width(6);
+ hbox->property_margin() = 6;
hbox->show();
auto label = Gtk::manage(new Gtk::Label("Choose a font: "));
diff --git a/examples/book/progressbar/examplewindow.cc b/examples/book/progressbar/examplewindow.cc
index b43c15a..94cc25d 100644
--- a/examples/book/progressbar/examplewindow.cc
+++ b/examples/book/progressbar/examplewindow.cc
@@ -28,7 +28,7 @@ ExampleWindow::ExampleWindow()
set_resizable();
set_title("Gtk::ProgressBar");
- m_VBox.set_border_width(10);
+ m_VBox.property_margin() = 10;
add(m_VBox);
m_VBox.pack_start(m_ProgressBar, Gtk::PACK_SHRINK, 5);
diff --git a/examples/book/range_widgets/examplewindow.cc b/examples/book/range_widgets/examplewindow.cc
index d5431e0..167db2c 100644
--- a/examples/book/range_widgets/examplewindow.cc
+++ b/examples/book/range_widgets/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -68,7 +66,7 @@ ExampleWindow::ExampleWindow()
add(m_VBox_Top);
m_VBox_Top.pack_start(m_VBox2);
- m_VBox2.set_border_width(10);
+ m_VBox2.property_margin() = 10;
m_VBox2.pack_start(m_HBox_Scales);
//Put VScale and HScale (above scrollbar) side-by-side.
@@ -139,7 +137,7 @@ ExampleWindow::ExampleWindow()
m_Button_Quit.grab_default();
m_Button_Quit.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_quit));
- m_Button_Quit.set_border_width(10);
+ m_Button_Quit.property_margin() = 10;
show_all_children();
}
diff --git a/examples/book/revealer/examplewindow.cc b/examples/book/revealer/examplewindow.cc
index d67162d..c0078f1 100644
--- a/examples/book/revealer/examplewindow.cc
+++ b/examples/book/revealer/examplewindow.cc
@@ -26,7 +26,6 @@ ExampleWindow::ExampleWindow()
{
// Window properties
set_title("Revealer Example");
- set_border_width(12);
set_resizable(false);
// Transition type selector
@@ -56,6 +55,7 @@ ExampleWindow::ExampleWindow()
m_vbox.pack_start(m_controls, Gtk::PACK_SHRINK, 0);
m_vbox.pack_start(m_separator, Gtk::PACK_SHRINK, 12);
m_vbox.pack_start(m_revealer, Gtk::PACK_EXPAND_WIDGET, 6);
+ m_vbox.property_margin() = 12;
add(m_vbox);
show_all_children();
diff --git a/examples/book/scrolledwindow/examplewindow.cc b/examples/book/scrolledwindow/examplewindow.cc
index 546f757..9f8bfb5 100644
--- a/examples/book/scrolledwindow/examplewindow.cc
+++ b/examples/book/scrolledwindow/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -22,10 +20,9 @@
ExampleWindow::ExampleWindow()
{
set_title("Gtk::ScrolledWindow example");
- set_border_width(0);
set_size_request(300, 300);
- m_ScrolledWindow.set_border_width(10);
+ m_ScrolledWindow.property_margin() = 10;
/* the policy is one of Gtk::POLICY AUTOMATIC, or Gtk::POLICY_ALWAYS.
* Gtk::POLICY_AUTOMATIC will automatically decide whether you need
diff --git a/examples/book/searchbar/examplewindow.cc b/examples/book/searchbar/examplewindow.cc
index 53d2e43..d0de634 100644
--- a/examples/book/searchbar/examplewindow.cc
+++ b/examples/book/searchbar/examplewindow.cc
@@ -26,7 +26,6 @@ ExampleWindow::ExampleWindow()
{
// Window properties
set_title("SearchBar Example");
- set_border_width(12);
set_size_request(500, -1); // To provide space for the searchbar when it appears.
// Search bar properties
@@ -75,6 +74,7 @@ ExampleWindow::ExampleWindow()
m_vbox.pack_start(m_label, Gtk::PACK_SHRINK, 6);
m_vbox.pack_start(m_separator, Gtk::PACK_SHRINK, 12);
m_vbox.pack_start(m_options_grid, Gtk::PACK_SHRINK, 12);
+ m_vbox.property_margin() = 12;
add(m_vbox);
show_all_children();
diff --git a/examples/book/spinbutton/examplewindow.cc b/examples/book/spinbutton/examplewindow.cc
index 593c29c..5f49533 100644
--- a/examples/book/spinbutton/examplewindow.cc
+++ b/examples/book/spinbutton/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -55,12 +53,12 @@ ExampleWindow::ExampleWindow()
{
set_title("SpinButton");
- m_VBox_Main.set_border_width(10);
+ m_VBox_Main.property_margin() = 10;
add(m_VBox_Main);
m_VBox_Main.pack_start(m_Frame_NotAccelerated);
- m_VBox.set_border_width(5);
+ m_VBox.property_margin() = 5;
m_Frame_NotAccelerated.add(m_VBox);
/* Day, month, year spinners */
@@ -93,7 +91,7 @@ ExampleWindow::ExampleWindow()
//Accelerated:
m_VBox_Main.pack_start(m_Frame_Accelerated);
- m_VBox_Accelerated.set_border_width(5);
+ m_VBox_Accelerated.property_margin() = 5;
m_Frame_Accelerated.add(m_VBox_Accelerated);
m_VBox_Accelerated.pack_start(m_HBox_Accelerated, Gtk::PACK_EXPAND_WIDGET, 5);
diff --git a/examples/book/textview/examplewindow.cc b/examples/book/textview/examplewindow.cc
index 5296a0c..895db2f 100644
--- a/examples/book/textview/examplewindow.cc
+++ b/examples/book/textview/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -25,9 +23,9 @@ ExampleWindow::ExampleWindow()
m_Button_Buffer2("Use buffer 2")
{
set_title("Gtk::TextView example");
- set_border_width(5);
set_default_size(400, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -44,7 +42,7 @@ ExampleWindow::ExampleWindow()
m_ButtonBox.pack_start(m_Button_Buffer1, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Buffer2, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_spacing(5);
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
diff --git a/examples/book/timeout/timerexample.cc b/examples/book/timeout/timerexample.cc
index 613a776..6eca382 100644
--- a/examples/book/timeout/timerexample.cc
+++ b/examples/book/timeout/timerexample.cc
@@ -1,5 +1,3 @@
-//$Id: timerexample.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2003 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -27,8 +25,7 @@ TimerExample::TimerExample() :
count_value(5), // each timer will count down 5 times before disconnecting
timeout_value(1500) // 1500 ms = 1.5 seconds
{
- set_border_width(10);
-
+ m_Box.property_margin() = 10;
add(m_Box);
m_Box.pack_start(m_ButtonAddTimer);
m_Box.pack_start(m_ButtonDeleteTimer);
@@ -55,7 +52,7 @@ void TimerExample::on_button_add_timer()
// Creation of a new object prevents long lines and shows us a little
// how slots work. We have 0 parameters and bool as a return value
// after calling sigc::bind.
- sigc::slot<bool> my_slot = sigc::bind(sigc::mem_fun(*this,
+ sigc::slot<bool()> my_slot = sigc::bind(sigc::mem_fun(*this,
&TimerExample::on_timeout), m_timer_number);
// This is where we connect the slot to the Glib::signal_timeout()
diff --git a/examples/book/toolbar/examplewindow.cc b/examples/book/toolbar/examplewindow.cc
index 454d911..925b8de 100644
--- a/examples/book/toolbar/examplewindow.cc
+++ b/examples/book/toolbar/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 870 2007-07-13 19:08:46Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -31,7 +29,7 @@ ExampleWindow::ExampleWindow()
//Put a toolbar at the top, and a button underneath:
m_VBox.pack_start(m_Toolbar, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_VBox.pack_end(m_ButtonBox, Gtk::PACK_SHRINK);
diff --git a/examples/book/toolpalette/canvas.cc b/examples/book/toolpalette/canvas.cc
index fe14aef..2cb444a 100644
--- a/examples/book/toolpalette/canvas.cc
+++ b/examples/book/toolpalette/canvas.cc
@@ -21,7 +21,6 @@ Canvas::Canvas()
: m_drag_data_requested_for_drop(false),
m_drop_item(nullptr)
{
- set_app_paintable();
}
Canvas::~Canvas()
diff --git a/examples/book/toolpalette/examplewindow.cc b/examples/book/toolpalette/examplewindow.cc
index a35bfdf..568e831 100644
--- a/examples/book/toolpalette/examplewindow.cc
+++ b/examples/book/toolpalette/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 870 2007-07-13 19:08:46Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -186,8 +184,8 @@ ExampleWindow::ExampleWindow()
{
set_title("Gtk::ToolPalette example");
set_size_request(600, 600);
- set_border_width(6);
+ m_VBox.property_margin() = 6;
add(m_VBox);
//The Orientation ComboBox:
@@ -237,14 +235,14 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_HBox, Gtk::PACK_EXPAND_WIDGET);
m_ScrolledWindowPalette.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
- m_ScrolledWindowPalette.set_border_width(6);
+ m_ScrolledWindowPalette.property_margin() = 6;
m_ScrolledWindowPalette.add(m_ToolPalette);
m_HBox.pack_start(m_ScrolledWindowPalette);
on_combo_orientation_changed();
m_ScrolledWindowCanvas.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS);
- m_ScrolledWindowCanvas.set_border_width(6);
+ m_ScrolledWindowCanvas.property_margin() = 6;
m_ScrolledWindowCanvas.add(m_Canvas);
m_ScrolledWindowCanvas.set_size_request(200, -1);
m_HBox.pack_start(m_ScrolledWindowCanvas);
diff --git a/examples/book/tooltips/examplewindow.cc b/examples/book/tooltips/examplewindow.cc
index 8daf3bf..ba29909 100644
--- a/examples/book/tooltips/examplewindow.cc
+++ b/examples/book/tooltips/examplewindow.cc
@@ -1,5 +1,3 @@
-/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-
/* gtkmm example Copyright (C) 2007 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -34,8 +32,8 @@ ExampleWindow::ExampleWindow()
{
//Set up window and the top-level container:
set_title(app_title);
- set_border_width(10);
+ m_vbox.property_margin() = 10;
add(m_vbox);
//Check button with markup in tooltip:
diff --git a/examples/book/treeview/combo_renderer/examplewindow.cc
b/examples/book/treeview/combo_renderer/examplewindow.cc
index 7b26897..026de25 100644
--- a/examples/book/treeview/combo_renderer/examplewindow.cc
+++ b/examples/book/treeview/combo_renderer/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (ListStore) example");
- set_border_width(5);
set_default_size(400, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -39,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/drag_and_drop/examplewindow.cc
b/examples/book/treeview/drag_and_drop/examplewindow.cc
index f8dd9f4..d462301 100644
--- a/examples/book/treeview/drag_and_drop/examplewindow.cc
+++ b/examples/book/treeview/drag_and_drop/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("_Quit", true)
{
set_title("Gtk::TreeView (Drag and Drop) example");
- set_border_width(5);
set_default_size(400, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -39,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/editable_cells/examplewindow.cc
b/examples/book/treeview/editable_cells/examplewindow.cc
index a6b018d..2d8973d 100644
--- a/examples/book/treeview/editable_cells/examplewindow.cc
+++ b/examples/book/treeview/editable_cells/examplewindow.cc
@@ -28,10 +28,9 @@ ExampleWindow::ExampleWindow()
m_validate_retry(false)
{
set_title("Gtk::TreeView Editable Cells example");
- set_border_width(5);
set_default_size(400, 200);
-
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -44,7 +43,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/filter/examplewindow.cc b/examples/book/treeview/filter/examplewindow.cc
index 19a063e..f5734ae 100644
--- a/examples/book/treeview/filter/examplewindow.cc
+++ b/examples/book/treeview/filter/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (TreeModelFilter) example");
- set_border_width(5);
set_default_size(400, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -39,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/filter_modify/examplewindow.cc
b/examples/book/treeview/filter_modify/examplewindow.cc
index 7a43463..dbb64c1 100644
--- a/examples/book/treeview/filter_modify/examplewindow.cc
+++ b/examples/book/treeview/filter_modify/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (TreeModelFilter) example");
- set_border_width(5);
set_default_size(400, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -39,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/list/examplewindow.cc b/examples/book/treeview/list/examplewindow.cc
index c70eafe..e143251 100644
--- a/examples/book/treeview/list/examplewindow.cc
+++ b/examples/book/treeview/list/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (ListStore) example");
- set_border_width(5);
set_default_size(400, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -39,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/listviewtext/examplewindow.cc
b/examples/book/treeview/listviewtext/examplewindow.cc
index 0cca35f..4aa92f3 100644
--- a/examples/book/treeview/listviewtext/examplewindow.cc
+++ b/examples/book/treeview/listviewtext/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2006 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -25,9 +23,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::ListViewText example");
- set_border_width(6);
set_default_size(400, 200);
+ m_VBox.property_margin() = 6;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -40,7 +38,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/modelsort/examplewindow.cc
b/examples/book/treeview/modelsort/examplewindow.cc
index de602ee..24661c7 100644
--- a/examples/book/treeview/modelsort/examplewindow.cc
+++ b/examples/book/treeview/modelsort/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (TreeModelSort) example");
- set_border_width(6);
set_default_size(400, 400);
+ m_VBox.property_margin() = 6;
m_VBox.set_spacing(6);
add(m_VBox);
@@ -43,7 +41,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/popup/examplewindow.cc b/examples/book/treeview/popup/examplewindow.cc
index e0293e0..93f31ce 100644
--- a/examples/book/treeview/popup/examplewindow.cc
+++ b/examples/book/treeview/popup/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (ListStore) example");
- set_border_width(5);
set_default_size(400, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -39,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/treeview/tree/examplewindow.cc b/examples/book/treeview/tree/examplewindow.cc
index 24baefe..de865c0 100644
--- a/examples/book/treeview/tree/examplewindow.cc
+++ b/examples/book/treeview/tree/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (TreeStore) example");
- set_border_width(5);
set_default_size(400, 200);
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -39,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/book/update_ui/examplewindow.cc b/examples/book/update_ui/examplewindow.cc
index bdffa33..03db7db 100644
--- a/examples/book/update_ui/examplewindow.cc
+++ b/examples/book/update_ui/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -25,10 +23,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("_Quit", true)
{
set_title("update-ui example");
- set_border_width(6);
set_default_size(400, -1);
-
+ m_VBox.property_margin() = 6;
add(m_VBox);
m_VBox.pack_start(m_ProgressBar, Gtk::PACK_SHRINK);
@@ -36,7 +33,7 @@ ExampleWindow::ExampleWindow()
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Start, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(6);
+ m_ButtonBox.property_margin() = 6;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
diff --git a/examples/others/arrow/arrow.cc b/examples/others/arrow/arrow.cc
index 088c64a..8f2d473 100644
--- a/examples/others/arrow/arrow.cc
+++ b/examples/others/arrow/arrow.cc
@@ -52,14 +52,13 @@ AppWindow::AppWindow()
set_title ("Arrow Buttons");
- /* Sets the border width of the window. */
- set_border_width (10);
-
/* Create a grid to hold the arrows/buttons */
grid = Gtk::manage (new Gtk::Grid ());
grid->set_row_homogeneous(true);
grid->set_column_homogeneous(true);
- grid->set_border_width (2);
+
+ /* Set the margin around the grid. */
+ grid->property_margin() = 12;
/* Pack and show all our widgets */
button = Gtk::manage (new ArrowButton (Gtk::ARROW_UP));
diff --git a/examples/others/calendar/calendar.cc b/examples/others/calendar/calendar.cc
index 9618c0a..d6db5df 100644
--- a/examples/others/calendar/calendar.cc
+++ b/examples/others/calendar/calendar.cc
@@ -173,11 +173,10 @@ CalendarExample::CalendarExample()
settings_[i] = 0;
}
- set_border_width(5);
-
set_resizable(false);
auto vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, DEF_PAD));
+ vbox->property_margin() = 5;
add(*vbox);
/*
diff --git a/examples/others/cellrenderercustom/cellrendererpopup.cc
b/examples/others/cellrenderercustom/cellrendererpopup.cc
index 2f59e59..84a7bae 100644
--- a/examples/others/cellrenderercustom/cellrendererpopup.cc
+++ b/examples/others/cellrenderercustom/cellrendererpopup.cc
@@ -98,7 +98,7 @@ void CellRendererPopup::hide_popup()
signal_hide_popup_();
}
-//TODO: Port this to gtkmm 3:
+//TODO: Port this to gtkmm 4:
/*
void CellRendererPopup::get_preferred_size_vfunc(Gtk::Widget& widget,
const Gdk::Rectangle* cell_area,
@@ -157,17 +157,21 @@ void CellRendererPopup::on_show_popup(const Glib::ustring&, int, int y1, int x2,
const int button_height = y2 - y1;
- int screen_height = Gdk::screen_height() - y;
- const int screen_width = Gdk::screen_width();
+ auto display = Gdk::Display::get_default();
+ auto monitor = display->get_monitor_at_point(x2, y2);
+ Gdk::Rectangle workarea;
+ monitor->get_workarea(workarea);
+ int monitor_height = workarea.get_height() - y;
+ const int monitor_width = workarea.get_width();
// Check if it fits in the available height.
- if(alloc.get_height() > screen_height)
+ if(alloc.get_height() > monitor_height)
{
// It doesn't fit, so we see if we have the minimum space needed.
- if((alloc.get_height() > screen_height) && (y - button_height > screen_height))
+ if((alloc.get_height() > monitor_height) && (y - button_height > monitor_height))
{
// We don't, so we show the popup above the cell instead of below it.
- screen_height = y - button_height;
+ monitor_height = y - button_height;
y -= (alloc.get_height() + button_height);
y = std::max(0, y);
}
@@ -175,7 +179,7 @@ void CellRendererPopup::on_show_popup(const Glib::ustring&, int, int y1, int x2,
// We try to line it up with the right edge of the column, but we don't
// want it to go off the edges of the screen.
- x = std::min(x, screen_width);
+ x = std::min(x, monitor_width);
x -= alloc.get_width();
x = std::max(0, x);
diff --git a/examples/others/cellrenderercustom/cellrendererpopup.h
b/examples/others/cellrenderercustom/cellrendererpopup.h
index 9a39411..35f2db9 100644
--- a/examples/others/cellrenderercustom/cellrendererpopup.h
+++ b/examples/others/cellrenderercustom/cellrendererpopup.h
@@ -1,5 +1,3 @@
-//$Id: cellrendererpopup.h 156 2004-03-12 10:11:35Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -27,7 +25,7 @@ class CellRendererPopup : public Gtk::CellRendererText
{
public:
CellRendererPopup();
- virtual ~CellRendererPopup();
+ ~CellRendererPopup() override;
PopupEntry* get_popup_entry();
Gtk::Window* get_popup_window();
@@ -35,17 +33,17 @@ public:
void set_focus_widget(Gtk::Widget& focus_widget);
Gtk::Widget* get_focus_widget();
- typedef sigc::signal<void,const Glib::ustring&,int,int,int,int> SignalShowPopup;
+ using SignalShowPopup = sigc::signal<void(const Glib::ustring&,int,int,int,int)>;
SignalShowPopup& signal_show_popup();
- typedef sigc::signal<void> SignalHidePopup;
+ using SignalHidePopup = sigc::signal<void()>;
SignalHidePopup& signal_hide_popup();
void hide_popup();
protected:
- //TODO: Port this to gtkmm 3:
+ //TODO: Port this to gtkmm 4:
/*
void get_preferred_size_vfunc(Gtk::Widget& widget,
const Gdk::Rectangle* cell_area,
@@ -64,7 +62,7 @@ protected:
void on_hide_popup();
private:
- typedef CellRendererPopup Self;
+ using Self = CellRendererPopup;
SignalShowPopup signal_show_popup_;
SignalHidePopup signal_hide_popup_;
diff --git a/examples/others/cellrenderercustom/cellrenderertoggle.cc
b/examples/others/cellrenderercustom/cellrenderertoggle.cc
index d2e7235..9e78f73 100644
--- a/examples/others/cellrenderercustom/cellrenderertoggle.cc
+++ b/examples/others/cellrenderercustom/cellrenderertoggle.cc
@@ -38,11 +38,11 @@ public:
Glib::PropertyProxy<bool> property_active();
Glib::PropertyProxy<bool> property_radio();
- typedef sigc::signal<void, const Glib::ustring&> SignalToggled;
+ using SignalToggled = sigc::signal<void(const Glib::ustring&)>;
SignalToggled& signal_toggled();
protected:
- //TODO: Update for gtkmm 3. This isn't currently overriding anything.
+ //TODO: Update for gtkmm 4. This isn't currently overriding anything.
void get_preferred_size_vfunc(Gtk::Widget& widget,
const Gdk::Rectangle* cell_area,
int* x_offset, int* y_offset,
diff --git a/examples/others/cellrenderercustom/popupentry.h b/examples/others/cellrenderercustom/popupentry.h
index 8d2897a..288ba39 100644
--- a/examples/others/cellrenderercustom/popupentry.h
+++ b/examples/others/cellrenderercustom/popupentry.h
@@ -1,5 +1,3 @@
-//$Id: popupentry.h 156 2004-03-12 10:11:35Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -40,7 +38,7 @@ public:
static int get_button_width();
- typedef sigc::signal<void> type_signal_arrow_clicked;
+ using type_signal_arrow_clicked = sigc::signal<void()>;
type_signal_arrow_clicked& signal_arrow_clicked();
protected:
diff --git a/examples/others/exception/exceptiontest.cc b/examples/others/exception/exceptiontest.cc
index d350467..8561dbd 100644
--- a/examples/others/exception/exceptiontest.cc
+++ b/examples/others/exception/exceptiontest.cc
@@ -97,9 +97,9 @@ int main(int argc, char** argv)
Gtk::Window window;
window.set_title("Exception Handlers");
- window.set_border_width(10);
Gtk::Box *const box = new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 5);
+ box->property_margin() = 10;
window.add(*Gtk::manage(box));
// New exception handlers are inserted at the front of the per-thread
diff --git a/examples/others/idle/idle.cc b/examples/others/idle/idle.cc
index b19e8bd..a7ba406 100644
--- a/examples/others/idle/idle.cc
+++ b/examples/others/idle/idle.cc
@@ -57,8 +57,8 @@ IdleExample::IdleExample() :
hbox->pack_start(m_quit, Gtk::PACK_EXPAND_PADDING);
vbox->pack_start(*hbox);
- // set border and display all
- set_border_width(5);
+ // set margin and display all
+ vbox->property_margin() = 5;
add(*vbox);
show_all_children();
diff --git a/examples/others/tictactoe/tictactoe.h b/examples/others/tictactoe/tictactoe.h
index 9921e4f..f4d3d95 100644
--- a/examples/others/tictactoe/tictactoe.h
+++ b/examples/others/tictactoe/tictactoe.h
@@ -36,7 +36,7 @@ public:
void clear();
- sigc::signal<void> tictactoe;
+ sigc::signal<void()> tictactoe;
TicTacToe();
~TicTacToe();
diff --git a/examples/others/tictactoe/ttt_test.cc b/examples/others/tictactoe/ttt_test.cc
index 0d9912e..a24ea77 100644
--- a/examples/others/tictactoe/ttt_test.cc
+++ b/examples/others/tictactoe/ttt_test.cc
@@ -21,7 +21,7 @@ main (int argc, char *argv[])
Gtk::Window window;
window.set_title("Tic-Tac-Toe");
- window.set_border_width(10);
+ ttt->property_margin() = 10;
window.add(*ttt);
window.show_all_children();
diff --git a/examples/others/treemodelcustom/examplewindow.cc
b/examples/others/treemodelcustom/examplewindow.cc
index 4b9fbb6..bd14375 100644
--- a/examples/others/treemodelcustom/examplewindow.cc
+++ b/examples/others/treemodelcustom/examplewindow.cc
@@ -1,5 +1,3 @@
-//$Id: examplewindow.cc 114 2004-02-10 14:50:18Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,10 +22,9 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("Gtk::TreeView (custom TreeModel) example");
- set_border_width(5);
set_default_size(400, 200);
-
+ m_VBox.property_margin() = 5;
add(m_VBox);
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
@@ -40,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
+ m_ButtonBox.property_margin() = 5;
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this, &ExampleWindow::on_button_quit) );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]