[gtkmm-documentation] Remove use of reduced API.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] Remove use of reduced API.
- Date: Mon, 31 May 2010 10:07:06 +0000 (UTC)
commit 7e4518b0bdfff3db1b096cea63d5725fd418bd08
Author: Murray Cumming <murrayc murrayc com>
Date: Mon May 31 12:06:57 2010 +0200
Remove use of reduced API.
* examples/*.[h|cc]: Remove all ifdefed code that supported the various
reduced API, because we no longer support that in latest glibmm and gtkmm.
ChangeLog | 7 +++++++
examples/book/builder/basic/main.cc | 10 ----------
examples/book/builder/derived/main.cc | 10 ----------
.../book/custom/custom_container/examplewindow.cc | 4 ----
examples/book/custom/custom_widget/mywidget.cc | 2 --
examples/book/custom/custom_widget/mywidget.h | 2 --
examples/book/iconview/examplewindow.cc | 5 -----
examples/book/input/main.cc | 7 -------
examples/book/menus/main_menu/examplewindow.cc | 9 ---------
examples/book/menus/popup/examplewindow.cc | 9 ---------
examples/book/menus_and_toolbars/examplewindow.cc | 18 ------------------
examples/book/printing/advanced/examplewindow.cc | 20 --------------------
examples/book/printing/advanced/previewdialog.cc | 6 ------
examples/book/printing/simple/examplewindow.cc | 20 --------------------
examples/book/recent_files/examplewindow.cc | 7 -------
examples/book/tooltips/examplewindow.cc | 5 -----
.../book/treeview/combo_renderer/examplewindow.cc | 16 ----------------
.../book/treeview/drag_and_drop/treemodel_dnd.cc | 2 --
.../book/treeview/editable_cells/examplewindow.cc | 8 --------
examples/book/treeview/list/examplewindow.cc | 4 ----
examples/book/treeview/popup/treeview_withpopup.cc | 1 -
.../others/cellrenderercustom/cellrendererpopup.cc | 11 -----------
.../cellrenderercustom/cellrenderertoggle.cc | 18 ------------------
examples/others/cellrenderercustom/testpopup.cc | 8 --------
examples/others/exception/exceptiontest.cc | 4 ----
examples/others/rulers/rulers.cc | 11 -----------
26 files changed, 7 insertions(+), 217 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fde4aef..ad355e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-31 Murray Cumming <murrayc murrayc com>
+
+ Remove use of reduced API.
+
+ * examples/*.[h|cc]: Remove all ifdefed code that supported the various
+ reduced API, because we no longer support that in latest glibmm and gtkmm.
+
2010-05-07 David King <davidk openismus com>
Improve the Assistant example
diff --git a/examples/book/builder/basic/main.cc b/examples/book/builder/basic/main.cc
index df479f7..b76c749 100644
--- a/examples/book/builder/basic/main.cc
+++ b/examples/book/builder/basic/main.cc
@@ -16,7 +16,6 @@ int main (int argc, char **argv)
//Load the GtkBuilder file and instantiate its widgets:
Glib::RefPtr<Gtk::Builder> refBuilder = Gtk::Builder::create();
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
refBuilder->add_from_file("basic.ui");
@@ -31,15 +30,6 @@ int main (int argc, char **argv)
std::cerr << "BuilderError: " << ex.what() << std::endl;
return 1;
}
-#else
- std::auto_ptr<Glib::Error> error;
-
- if (!refBuilder->add_from_file("basic.ui", error))
- {
- std::cerr << error->what() << std::endl;
- return 1;
- }
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
//Get the GtkBuilder-instantiated Dialog:
refBuilder->get_widget("DialogBasic", pDialog);
diff --git a/examples/book/builder/derived/main.cc b/examples/book/builder/derived/main.cc
index d3550e4..dcf876b 100644
--- a/examples/book/builder/derived/main.cc
+++ b/examples/book/builder/derived/main.cc
@@ -25,7 +25,6 @@ int main (int argc, char **argv)
//Load the Glade file and instiate its widgets:
Glib::RefPtr<Gtk::Builder> refBuilder = Gtk::Builder::create();
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
refBuilder->add_from_file("basic.ui");
@@ -40,15 +39,6 @@ int main (int argc, char **argv)
std::cerr << "BuilderError: " << ex.what() << std::endl;
return 1;
}
-#else
- std::auto_ptr<Glib::Error> error;
-
- if (!refBuilder->add_from_file("basic.ui", error))
- {
- std::cerr << error->what() << std::endl;
- return 1;
- }
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
//Get the GtkBuilder-instantiated dialog::
DerivedDialog* pDialog = 0;
diff --git a/examples/book/custom/custom_container/examplewindow.cc b/examples/book/custom/custom_container/examplewindow.cc
index 7ed5c78..03aa5c5 100644
--- a/examples/book/custom/custom_container/examplewindow.cc
+++ b/examples/book/custom/custom_container/examplewindow.cc
@@ -35,11 +35,7 @@ ExampleWindow::ExampleWindow()
m_Button_One.show();
m_Button_Two.show();
-#ifdef GLIBMM_PROPERTIES_ENABLED
m_Button_Two.property_xalign() = 1.0f;
-#else
- m_Button_Two.set_property("xalign", 1.0f);
-#endif //GLIBMM_PROPERTIES_ENABLED
m_VBox.pack_start(m_MyContainer, Gtk::PACK_EXPAND_WIDGET);
m_MyContainer.show();
diff --git a/examples/book/custom/custom_widget/mywidget.cc b/examples/book/custom/custom_widget/mywidget.cc
index 9025d21..c08dcaa 100644
--- a/examples/book/custom/custom_widget/mywidget.cc
+++ b/examples/book/custom/custom_widget/mywidget.cc
@@ -57,7 +57,6 @@ MyWidget::~MyWidget()
{
}
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void MyWidget::on_size_request(Gtk::Requisition* requisition)
{
//Initialize the output parameter:
@@ -197,4 +196,3 @@ bool MyWidget::on_expose_event(GdkEventExpose* event)
}
return true;
}
-#endif /* GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED */
diff --git a/examples/book/custom/custom_widget/mywidget.h b/examples/book/custom/custom_widget/mywidget.h
index 2af729b..7c080eb 100644
--- a/examples/book/custom/custom_widget/mywidget.h
+++ b/examples/book/custom/custom_widget/mywidget.h
@@ -29,7 +29,6 @@ public:
protected:
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
//Overrides:
virtual void on_size_request(Gtk::Requisition* requisition);
virtual void on_size_allocate(Gtk::Allocation& allocation);
@@ -38,7 +37,6 @@ protected:
virtual void on_realize();
virtual void on_unrealize();
virtual bool on_expose_event(GdkEventExpose* event);
-#endif /* GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED */
Glib::RefPtr<Gdk::Window> m_refGdkWindow;
diff --git a/examples/book/iconview/examplewindow.cc b/examples/book/iconview/examplewindow.cc
index b218ec7..02c2900 100644
--- a/examples/book/iconview/examplewindow.cc
+++ b/examples/book/iconview/examplewindow.cc
@@ -152,12 +152,7 @@ void ExampleWindow::add_entry(const std::string& filename,
row[m_Columns.m_col_filename] = filename;
row[m_Columns.m_col_description] = description;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(filename);
- #else
- std::auto_ptr<Glib::Error> error;
- row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(filename, error);
- #endif //GLIBMM_EXCEPTIONS_ENABLED
}
diff --git a/examples/book/input/main.cc b/examples/book/input/main.cc
index 539d039..9cf3095 100644
--- a/examples/book/input/main.cc
+++ b/examples/book/input/main.cc
@@ -32,14 +32,7 @@ bool MyCallback(Glib::IOCondition io_condition)
else {
Glib::ustring buf;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
iochannel->read_line(buf);
- #else
- std::auto_ptr<Glib::Error> ex;
- iochannel->read_line(buf, ex);
- if(ex.get())
- std::cerr << "Error: " << ex->what() << std::endl;
- #endif //GLIBMM_EXCEPTIONS_ENABLED
std::cout << buf;
if (buf == "Q\n")
Gtk::Main::quit ();
diff --git a/examples/book/menus/main_menu/examplewindow.cc b/examples/book/menus/main_menu/examplewindow.cc
index df25076..d7b385c 100644
--- a/examples/book/menus/main_menu/examplewindow.cc
+++ b/examples/book/menus/main_menu/examplewindow.cc
@@ -113,7 +113,6 @@ ExampleWindow::ExampleWindow()
" </toolbar>"
"</ui>";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refUIManager->add_ui_from_string(ui_info);
@@ -122,14 +121,6 @@ ExampleWindow::ExampleWindow()
{
std::cerr << "building menus failed: " << ex.what();
}
- #else
- std::auto_ptr<Glib::Error> ex;
- m_refUIManager->add_ui_from_string(ui_info, ex);
- if(ex.get())
- {
- std::cerr << "building menus failed: " << ex->what();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//Get the menubar and toolbar widgets, and add them to a container widget:
Gtk::Widget* pMenubar = m_refUIManager->get_widget("/MenuBar");
diff --git a/examples/book/menus/popup/examplewindow.cc b/examples/book/menus/popup/examplewindow.cc
index 7f30b48..6856599 100644
--- a/examples/book/menus/popup/examplewindow.cc
+++ b/examples/book/menus/popup/examplewindow.cc
@@ -81,7 +81,6 @@ ExampleWindow::ExampleWindow()
" </popup>"
"</ui>";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refUIManager->add_ui_from_string(ui_info);
@@ -90,14 +89,6 @@ ExampleWindow::ExampleWindow()
{
std::cerr << "building menus failed: " << ex.what();
}
- #else
- std::auto_ptr<Glib::Error> ex;
- m_refUIManager->add_ui_from_string(ui_info, ex);
- if(ex.get())
- {
- std::cerr << "building menus failed: " << ex->what();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//Get the menu:
m_pMenuPopup = dynamic_cast<Gtk::Menu*>(
diff --git a/examples/book/menus_and_toolbars/examplewindow.cc b/examples/book/menus_and_toolbars/examplewindow.cc
index 3f5b23b..61793a1 100644
--- a/examples/book/menus_and_toolbars/examplewindow.cc
+++ b/examples/book/menus_and_toolbars/examplewindow.cc
@@ -82,7 +82,6 @@ ExampleWindow::ExampleWindow()
" </toolbar>"
"</ui>";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refUIManager->add_ui_from_string(ui_info);
@@ -91,14 +90,6 @@ ExampleWindow::ExampleWindow()
{
std::cerr << "building menus and toolbars failed: " << ex.what();
}
- #else
- std::auto_ptr<Glib::Error> ex;
- m_refUIManager->add_ui_from_string(ui_info, ex);
- if(ex.get())
- {
- std::cerr << "building menus and toolbars failed: " << ex->what();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
Gtk::Widget* pMenuBar = m_refUIManager->get_widget("/MenuBar") ;
@@ -142,7 +133,6 @@ void ExampleWindow::add_stock_item(
Gtk::IconSource source;
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
//This throws an exception if the file is not found:
@@ -152,14 +142,6 @@ void ExampleWindow::add_stock_item(
{
std::cout << ex.what() << std::endl;
}
- #else
- std::auto_ptr<Glib::Error> ex;
- pixbuf = Gdk::Pixbuf::create_from_file(filepath, ex);
- if(ex.get())
- {
- std::cerr << ex->what();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
if(!pixbuf)
return;
diff --git a/examples/book/printing/advanced/examplewindow.cc b/examples/book/printing/advanced/examplewindow.cc
index 409c08e..6a88696 100644
--- a/examples/book/printing/advanced/examplewindow.cc
+++ b/examples/book/printing/advanced/examplewindow.cc
@@ -130,7 +130,6 @@ void ExampleWindow::build_main_menu()
" </toolbar>"
"</ui>";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refUIManager->add_ui_from_string(ui_info);
@@ -139,14 +138,6 @@ void ExampleWindow::build_main_menu()
{
std::cerr << "building menus failed: " << ex.what();
}
- #else
- std::auto_ptr<Glib::Error> ex;
- m_refUIManager->add_ui_from_string(ui_info, ex);
- if(ex.get())
- {
- std::cerr << "building menus failed: " << ex->what();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//Get the menubar and toolbar widgets, and add them to a container widget:
@@ -222,7 +213,6 @@ void ExampleWindow::print_or_preview(Gtk::PrintOperationAction print_action)
//after it has been completed.
print->signal_done().connect(sigc::bind(sigc::mem_fun(*this,
&ExampleWindow::on_printoperation_done), &print));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
print->run(print_action /* print or preview */, *this);
@@ -233,16 +223,6 @@ void ExampleWindow::print_or_preview(Gtk::PrintOperationAction print_action)
std::cerr << "An error occurred while trying to run a print operation:"
<< ex.what() << std::endl;
}
-#else
- std::auto_ptr<Glib::Error> error;
- print->run(print_action /* print or preview */, *this, error);
-
- if (error.get())
- {
- std::cerr << "An error occurred while trying to run a print operation:"
- << error->what() << std::endl;
- }
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
g_debug("print status: %s", print->get_status_string().c_str());
}
diff --git a/examples/book/printing/advanced/previewdialog.cc b/examples/book/printing/advanced/previewdialog.cc
index eb70916..5e438f9 100644
--- a/examples/book/printing/advanced/previewdialog.cc
+++ b/examples/book/printing/advanced/previewdialog.cc
@@ -108,13 +108,7 @@ bool PreviewDialog::on_drawing_area_expose_event(GdkEventExpose* /* event */)
void PreviewDialog::on_popreview_ready(const Glib::RefPtr<Gtk::PrintContext>&)
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
m_PageSpin.set_range(1.0, m_pOperation->property_n_pages());
-#else
- int n_pages = 0;
- m_pOperation->get_property("n-pages", n_pages);
- m_PageSpin.set_range(1.0, n_pages);
-#endif
m_DrawingArea.queue_draw();
}
diff --git a/examples/book/printing/simple/examplewindow.cc b/examples/book/printing/simple/examplewindow.cc
index 8d46809..9d3707b 100644
--- a/examples/book/printing/simple/examplewindow.cc
+++ b/examples/book/printing/simple/examplewindow.cc
@@ -128,7 +128,6 @@ void ExampleWindow::build_main_menu()
" </toolbar>"
"</ui>";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refUIManager->add_ui_from_string(ui_info);
@@ -137,14 +136,6 @@ void ExampleWindow::build_main_menu()
{
std::cerr << "building menus failed: " << ex.what();
}
- #else
- std::auto_ptr<Glib::Error> ex;
- m_refUIManager->add_ui_from_string(ui_info, ex);
- if(ex.get())
- {
- std::cerr << "building menus failed: " << ex->what();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//Get the menubar and toolbar widgets, and add them to a container widget:
Gtk::Widget* pMenubar = m_refUIManager->get_widget("/MenuBar");
@@ -217,7 +208,6 @@ void ExampleWindow::print_or_preview(Gtk::PrintOperationAction print_action)
print->signal_done().connect(sigc::bind(sigc::mem_fun(*this,
&ExampleWindow::on_printoperation_done), print));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
print->run(print_action /* print or preview */, *this);
@@ -228,16 +218,6 @@ void ExampleWindow::print_or_preview(Gtk::PrintOperationAction print_action)
std::cerr << "An error occurred while trying to run a print operation:"
<< ex.what() << std::endl;
}
-#else
- std::auto_ptr<Glib::Error> ex;
- print->run(print_action /* print or preview */, *this, ex);
-
- if (ex.get())
- {
- std::cerr << "An error occurred while trying to run a print operation:"
- << ex->what() << std::endl;
- }
-#endif /* !GLIBMM_EXCEPTIONS_ENABLED */
}
void ExampleWindow::on_menu_file_new()
diff --git a/examples/book/recent_files/examplewindow.cc b/examples/book/recent_files/examplewindow.cc
index 45e84bc..6622fcf 100644
--- a/examples/book/recent_files/examplewindow.cc
+++ b/examples/book/recent_files/examplewindow.cc
@@ -76,7 +76,6 @@ ExampleWindow::ExampleWindow()
" </toolbar>"
"</ui>";
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
m_refUIManager->add_ui_from_string(ui_info);
@@ -85,12 +84,6 @@ ExampleWindow::ExampleWindow()
{
std::cerr << "building menus failed: " << ex.what();
}
- #else
- std::auto_ptr<Glib::Error> ex;
- m_refUIManager->add_ui_from_string(ui_info, ex);
- if(ex.get())
- std::cerr << "building menus failed: " << ex->what();
- #endif //GLIBMM_EXCEPTIONS_ENABLED
//Get the menubar and toolbar widgets, and add them to a container widget:
Gtk::Widget* pMenubar = m_refUIManager->get_widget("/MenuBar");
diff --git a/examples/book/tooltips/examplewindow.cc b/examples/book/tooltips/examplewindow.cc
index 7013eee..e10bf5f 100644
--- a/examples/book/tooltips/examplewindow.cc
+++ b/examples/book/tooltips/examplewindow.cc
@@ -142,12 +142,7 @@ bool ExampleWindow::on_textview_query_tooltip(int x, int y, bool keyboard_toolti
if (keyboard_tooltip)
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
int offset = m_ref_text_buffer->property_cursor_position().get_value();
-#else
- int offset = 0;
- m_ref_text_buffer->get_property("cursor-position", offset);
-#endif
iter = m_ref_text_buffer->get_iter_at_offset(offset);
}
else
diff --git a/examples/book/treeview/combo_renderer/examplewindow.cc b/examples/book/treeview/combo_renderer/examplewindow.cc
index 4a17a29..a0e9e92 100644
--- a/examples/book/treeview/combo_renderer/examplewindow.cc
+++ b/examples/book/treeview/combo_renderer/examplewindow.cc
@@ -101,20 +101,12 @@ ExampleWindow::ExampleWindow()
m_TreeView.append_column(*pColumn);
//Make this View column represent the m_col_itemchosen model column:
-#ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(pRenderer->property_text(),
m_Columns.m_col_itemchosen);
-#else
- pColumn->add_attribute(*pRenderer, "text", m_Columns.m_col_itemchosen);
-#endif
// Allow the user to choose from this list to set the value in
// m_col_itemchosen:
-#ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(pRenderer->property_model(), m_Columns.m_col_choices);
-#else
- pColumn->add_attribute(*pRenderer, "model", m_Columns.m_col_itemchosen);
-#endif
// Alternatively, you could use just one combo model, in all rows, instead of
// mapping it to a model column:
@@ -122,20 +114,12 @@ ExampleWindow::ExampleWindow()
// This must be a text column, in m_refTreeModelCombo1, or
// m_refTreeModelCombo:
-#ifdef GLIBMM_PROPERTIES_ENABLED
pRenderer->property_text_column() = 0;
-#else
- pRenderer->set_property("text_column", 0);
-#endif
//Allow the user to edit the column:
//This is done automatically when we use View::append_column(model_column),
//but that uses a simple Text CellRenderer.
-#ifdef GLIBMM_PROPERTIES_ENABLED
pRenderer->property_editable() = true;
-#else
- pRenderer->set_property("editable", true);
-#endif
pRenderer->signal_edited().connect( sigc::mem_fun(*this,
&ExampleWindow::on_cellrenderer_choice_edited) );
diff --git a/examples/book/treeview/drag_and_drop/treemodel_dnd.cc b/examples/book/treeview/drag_and_drop/treemodel_dnd.cc
index c202d2d..ba3e72d 100644
--- a/examples/book/treeview/drag_and_drop/treemodel_dnd.cc
+++ b/examples/book/treeview/drag_and_drop/treemodel_dnd.cc
@@ -51,7 +51,6 @@ TreeModel_Dnd::row_draggable_vfunc(const Gtk::TreeModel::Path& path) const
return is_draggable;
}
-#ifdef GLIBMM_VFUNCS_ENABLED
return Gtk::TreeStore::row_draggable_vfunc(path);
#else
return false;
@@ -104,7 +103,6 @@ TreeModel_Dnd::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
//Gtk::TreeModel::Path::get_from_selection_data(selection_data, refThis,
//path_dragged_row);
-#ifdef GLIBMM_VFUNCS_ENABLED
return Gtk::TreeStore::row_drop_possible_vfunc(dest, selection_data);
#else
return false;
diff --git a/examples/book/treeview/editable_cells/examplewindow.cc b/examples/book/treeview/editable_cells/examplewindow.cc
index c67322e..0658eb8 100644
--- a/examples/book/treeview/editable_cells/examplewindow.cc
+++ b/examples/book/treeview/editable_cells/examplewindow.cc
@@ -97,11 +97,7 @@ ExampleWindow::ExampleWindow()
&ExampleWindow::treeviewcolumn_validated_on_cell_data) );
//Make the CellRenderer editable, and handle its editing signals:
-#ifdef GLIBMM_PROPERTIES_ENABLED
m_cellrenderer_validated.property_editable() = true;
-#else
- m_cellrenderer_validated.set_property("editable", true);
-#endif
m_cellrenderer_validated.signal_editing_started().connect(
sigc::mem_fun(*this,
@@ -142,11 +138,7 @@ void ExampleWindow::treeviewcolumn_validated_on_cell_data(
sprintf(buffer, "%d", model_value);
Glib::ustring view_text = buffer;
-#ifdef GLIBMM_PROPERTIES_ENABLED
m_cellrenderer_validated.property_text() = view_text;
-#else
- m_cellrenderer_validated.set_property("text", view_text);
-#endif
}
}
diff --git a/examples/book/treeview/list/examplewindow.cc b/examples/book/treeview/list/examplewindow.cc
index bf11f94..4e152b3 100644
--- a/examples/book/treeview/list/examplewindow.cc
+++ b/examples/book/treeview/list/examplewindow.cc
@@ -80,11 +80,7 @@ ExampleWindow::ExampleWindow()
Gtk::TreeViewColumn* pColumn = m_TreeView.get_column(cols_count - 1);
if(pColumn)
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
pColumn->add_attribute(cell->property_value(), m_Columns.m_col_percentage);
-#else
- pColumn->add_attribute(*cell, "value", m_Columns.m_col_percentage);
-#endif
}
//Make all the columns reorderable:
diff --git a/examples/book/treeview/popup/treeview_withpopup.cc b/examples/book/treeview/popup/treeview_withpopup.cc
index 737756d..0e7e65d 100644
--- a/examples/book/treeview/popup/treeview_withpopup.cc
+++ b/examples/book/treeview/popup/treeview_withpopup.cc
@@ -69,7 +69,6 @@ bool TreeView_WithPopup::on_button_press_event(GdkEventButton* event)
{
bool return_value = false;
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
//Call base class, to allow normal handling,
//such as allowing the row to be selected by the right-click:
return_value = TreeView::on_button_press_event(event);
diff --git a/examples/others/cellrenderercustom/cellrendererpopup.cc b/examples/others/cellrenderercustom/cellrendererpopup.cc
index fdc209f..7c12519 100644
--- a/examples/others/cellrenderercustom/cellrendererpopup.cc
+++ b/examples/others/cellrenderercustom/cellrendererpopup.cc
@@ -127,13 +127,8 @@ Gtk::CellEditable* CellRendererPopup::start_editing_vfunc(GdkEvent*,
Gtk::CellRendererState)
{
// If the cell isn't editable we return 0.
-#ifdef GLIBMM_PROPERTIES_ENABLED
if(!property_editable())
return 0;
-#else
- if(!(g_object_get_data(G_OBJECT(gobj()), "editable")))
- return 0;
-#endif
std::auto_ptr<PopupEntry> popup_entry (new PopupEntry(path));
@@ -141,13 +136,7 @@ Gtk::CellEditable* CellRendererPopup::start_editing_vfunc(GdkEvent*,
popup_entry->signal_arrow_clicked().connect(sigc::mem_fun(*this, &Self::on_popup_arrow_clicked));
popup_entry->signal_hide ().connect(sigc::mem_fun(*this, &Self::on_popup_hide));
-#ifdef GLIBMM_PROPERTIES_ENABLED
popup_entry->set_text(property_text());
-#else
- Glib::ustring text;
- get_property("text", text);
- popup_entry->set_property("text", text)
-#endif
popup_entry->show();
diff --git a/examples/others/cellrenderercustom/cellrenderertoggle.cc b/examples/others/cellrenderercustom/cellrenderertoggle.cc
index ac6e620..9087229 100644
--- a/examples/others/cellrenderercustom/cellrenderertoggle.cc
+++ b/examples/others/cellrenderercustom/cellrenderertoggle.cc
@@ -102,15 +102,9 @@ MyCellRendererToggle::MyCellRendererToggle()
property_active_ (*this, "active", false),
property_radio_ (*this, "radio", false)
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
property_xpad() = 2;
property_ypad() = 2;
-#else
- set_property("mode", Gtk::CELL_RENDERER_MODE_ACTIVATABLE);
- set_property("xpad", 2);
- set_property("ypad", 2);
-#endif
}
MyCellRendererToggle::~MyCellRendererToggle()
@@ -143,17 +137,10 @@ void MyCellRendererToggle::get_size_vfunc(Gtk::Widget&,
{
enum { TOGGLE_WIDTH = 12 };
-#ifdef GLIBMM_PROPERTIES_ENABLED
const unsigned int xpad = property_xpad();
const unsigned int ypad = property_ypad();
const unsigned int xalign = property_xalign();
const unsigned int yalign = property_yalign();
-#else
- const unsigned int xpad = (unsigned int)g_object_get_data(G_OBJECT(gobj()), "xpad");
- const unsigned int ypad = (unsigned int)g_object_get_data(G_OBJECT(gobj()), "ypad");
- const unsigned int xalign = (unsigned int)g_object_get_data(G_OBJECT(gobj()), "xalign");
- const unsigned int yalign = (unsigned int)g_object_get_data(G_OBJECT(gobj()), "yalign");
-#endif
const int calc_width = xpad * 2 + TOGGLE_WIDTH;
const int calc_height = ypad * 2 + TOGGLE_WIDTH;
@@ -187,13 +174,8 @@ void MyCellRendererToggle::render_vfunc(const Glib::RefPtr<Gdk::Drawable>& windo
const Gdk::Rectangle&,
Gtk::CellRendererState flags)
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
const unsigned int cell_xpad = property_xpad();
const unsigned int cell_ypad = property_ypad();
-#else
- const unsigned int cell_xpad = (unsigned int)g_object_get_data(G_OBJECT(gobj()), "xpad");
- const unsigned int cell_ypad = (unsigned int)g_object_get_data(G_OBJECT(gobj()), "ypad");
-#endif
int x_offset = 0, y_offset = 0, width = 0, height = 0;
diff --git a/examples/others/cellrenderercustom/testpopup.cc b/examples/others/cellrenderercustom/testpopup.cc
index 5662a94..09a3b0b 100644
--- a/examples/others/cellrenderercustom/testpopup.cc
+++ b/examples/others/cellrenderercustom/testpopup.cc
@@ -64,11 +64,7 @@ AppWindow::AppWindow()
tree_view_.append_column(*Gtk::manage(column));
-#ifdef GLIBMM_PROPERTIES_ENABLED
column->add_attribute(renderer->property_text(), list_columns_.text2);
-#else
- column->add_attribute(*renderer, "text", list_columns_.text2);
-#endif
renderer->append_list_item("foo");
renderer->append_list_item("bar");
@@ -77,11 +73,7 @@ AppWindow::AppWindow()
renderer->append_list_item("sliff");
renderer->append_list_item("sloff");
-#ifdef GLIBMM_PROPERTIES_ENABLED
renderer->property_editable() = true;
-#else
- renderer->set_property("editable", true);
-#endif
renderer->signal_edited().connect(sigc::mem_fun(*this, &AppWindow::on_cell_edited));
}
diff --git a/examples/others/exception/exceptiontest.cc b/examples/others/exception/exceptiontest.cc
index 47bf17c..1330aff 100644
--- a/examples/others/exception/exceptiontest.cc
+++ b/examples/others/exception/exceptiontest.cc
@@ -8,7 +8,6 @@
#include <gtkmm/box.h>
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
namespace
{
@@ -89,7 +88,6 @@ void handler2()
} // anonymous namespace
-#endif //GLIBMM_EXCEPTIONS_ENABLED
int main(int argc, char** argv)
{
@@ -102,7 +100,6 @@ int main(int argc, char** argv)
Gtk::Box *const box = new Gtk::VBox(true, 5);
window.add(*Gtk::manage(box));
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
// New exception handlers are inserted at the front of the per-thread
// handler list. Thus, in this example handler2() is executed before
// handler1().
@@ -129,7 +126,6 @@ int main(int argc, char** argv)
button5->signal_clicked().connect(sigc::mem_fun(conn_handler1, &sigc::connection::disconnect));
button6->signal_clicked().connect(sigc::mem_fun(conn_handler2, &sigc::connection::disconnect));
-#endif //GLIBMM_EXCEPTIONS_ENABLED
window.show_all_children();
Gtk::Main::run(window);
diff --git a/examples/others/rulers/rulers.cc b/examples/others/rulers/rulers.cc
index f477e25..b972144 100644
--- a/examples/others/rulers/rulers.cc
+++ b/examples/others/rulers/rulers.cc
@@ -65,19 +65,8 @@ bool Rulers::on_area_motion_notify_event(GdkEventMotion* event)
if(event)
{
-#ifdef GLIBMM_PROPERTIES_ENABLED
m_hrule.property_position().set_value(event->x);
m_vrule.property_position().set_value(event->y);
-#else
- Glib::Value<double> property_value;
- property_value.init(Glib::Value<double>::value_type());
-
- property_value.set(event->x);
- m_hrule.set_property_value("position", property_value);
-
- property_value.set(event->y);
- m_vrule.set_property_value("position", property_value);
-#endif
}
return false; //false = signal not fully handled, pass it on..
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]